private void CREATE_NEW_LIST()
{
SqlCommand COM = null;
SqlTransaction TRANSACTION = null;
SqlConnection CON = new SqlConnection(CONSTR_LG);
if (CON.State != ConnectionState.Open)
CON.Open();
TRANSACTION = CON.BeginTransaction();
COM = INSERT_INTO_BM_PNTAWARDFICHE(int.Parse(le_CAPIFIRM.EditValue.ToString()), int.Parse(textEditYIL.Text), int.Parse(comboBoxEditAY.Text));
COM.Connection = CON;
COM.Transaction = TRANSACTION;
int LOGICALREF = int.Parse(COM.ExecuteScalar().ToString());
// YUKARIDA EXECUTE SCALAR OLDUGU ICIN GEREK YOK BUNA: COM.ExecuteNonQuery();
COM = UTILITIES.DELETE_PNTAWARDLINES(int.Parse(le_CAPIFIRM.EditValue.ToString()), int.Parse(textEditYIL.Text), int.Parse(comboBoxEditAY.Text));
COM.Connection = CON;
COM.Transaction = TRANSACTION;
COM.ExecuteNonQuery();
TRANSACTION.Commit();
}
public static SqlCommand INSERT_INTO_BM_PNTAWARDFICHE(int FIRMNR, int YEAR, int MONTH)
{
try
{
return new SqlCommand("INSERT INTO BM_PNTAWARDFICHE(FIRMNR, YEAR, MONTH, FOOD, TRANSPORTATION, OBIM, KASA, FOOD_B, TRANSPORTATION_B, OBIM_B, KASA_B, CREATEDBY, CREATEDDATE, MODIFIEDBY, MODIFIEDDATE) VALUES ('" + FIRMNR + "', " + YEAR + ", " + MONTH + ", 0, 0,0, 0, 0, 0, 0, 0, 99, '" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', 0, 0) select SCOPE_IDENTITY() ");
}
catch { return null; }
}
public static string CONSTR_LG = string.Format("Data Source={0};Initial Catalog={1};User Id={2};Password={3};MultipleActiveResultSets=True;", BMS_DLL.CFGICERIK.LGDBSERVER, BMS_DLL.CFGICERIK.LGDBDATABASE, BMS_DLL.CFGICERIK.LGDBUSERNAME, BMS_DLL.CFGICERIK.LGDBPASSWORD);
{
SqlCommand COM = null;
SqlTransaction TRANSACTION = null;
SqlConnection CON = new SqlConnection(CONSTR_LG);
if (CON.State != ConnectionState.Open)
CON.Open();
TRANSACTION = CON.BeginTransaction();
COM = INSERT_INTO_BM_PNTAWARDFICHE(int.Parse(le_CAPIFIRM.EditValue.ToString()), int.Parse(textEditYIL.Text), int.Parse(comboBoxEditAY.Text));
COM.Connection = CON;
COM.Transaction = TRANSACTION;
int LOGICALREF = int.Parse(COM.ExecuteScalar().ToString());
// YUKARIDA EXECUTE SCALAR OLDUGU ICIN GEREK YOK BUNA: COM.ExecuteNonQuery();
COM = UTILITIES.DELETE_PNTAWARDLINES(int.Parse(le_CAPIFIRM.EditValue.ToString()), int.Parse(textEditYIL.Text), int.Parse(comboBoxEditAY.Text));
COM.Connection = CON;
COM.Transaction = TRANSACTION;
COM.ExecuteNonQuery();
TRANSACTION.Commit();
}
public static SqlCommand INSERT_INTO_BM_PNTAWARDFICHE(int FIRMNR, int YEAR, int MONTH)
{
try
{
return new SqlCommand("INSERT INTO BM_PNTAWARDFICHE(FIRMNR, YEAR, MONTH, FOOD, TRANSPORTATION, OBIM, KASA, FOOD_B, TRANSPORTATION_B, OBIM_B, KASA_B, CREATEDBY, CREATEDDATE, MODIFIEDBY, MODIFIEDDATE) VALUES ('" + FIRMNR + "', " + YEAR + ", " + MONTH + ", 0, 0,0, 0, 0, 0, 0, 0, 99, '" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', 0, 0) select SCOPE_IDENTITY() ");
}
catch { return null; }
}
public static string CONSTR_LG = string.Format("Data Source={0};Initial Catalog={1};User Id={2};Password={3};MultipleActiveResultSets=True;", BMS_DLL.CFGICERIK.LGDBSERVER, BMS_DLL.CFGICERIK.LGDBDATABASE, BMS_DLL.CFGICERIK.LGDBUSERNAME, BMS_DLL.CFGICERIK.LGDBPASSWORD);
No comments:
Post a Comment