private void buttonMasterData_Click(object sender, EventArgs e) { string MasterDataQuery = "DECLARE @StoreID int = 0 SELECT @StoreID = ISNULL(redStoreID, 0) FROM redStoreOverride WHERE redStoreID = " + StoreID + " SELECT @StoreID StoreID"; DataTable MasterDataDT = Catman_Class_Library.SqlFunctions_RedReport.GetData(MasterDataQuery); DataRow MasterDataDR = MasterDataDT.Rows[0]; if (MasterDataDR["StoreID"].ToString() == "0") { FormCreateStoreData formCreateStoreData = new FormCreateStoreData(); formCreateStoreData._StoreID = StoreID; formCreateStoreData.ShowDialog(); } else { string MasterDataUpdateQuery = "SELECT redStoreOverrideID FROM redStoreOverride WHERE redStoreID = " + StoreID; DataTable MasterDataUpdateDT = Catman_Class_Library.SqlFunctions_RedReport.GetData(MasterDataUpdateQuery); DataRow MasterDataUpdateDR = MasterDataUpdateDT.Rows[0]; FormUpdateStoreData formUpdateStoreData = new FormUpdateStoreData(); formUpdateStoreData._StoreID = MasterDataUpdateDR["redStoreOverrideID"].ToString(); formUpdateStoreData.ShowDialog(); } }
private void buttonOverrideAS400_Click(object sender, EventArgs e) { if (buttonOverrideAS400.Text == "Edit") { //FormUpdateStoreOverride updateStoreOverride = new FormUpdateStoreOverride(); //updateStoreOverride._StoreID = Convert.ToInt32(StoreID); //updateStoreOverride.ShowDialog(); string MasterDataQuery = "DECLARE @StoreID int = 0 SELECT @StoreID = ISNULL(redStoreID, 0) FROM redStoreOverride WHERE redStoreID = " + StoreID + " SELECT @StoreID StoreID"; DataTable MasterDataDT = Catman_Class_Library.SqlFunctions_RedReport.GetData(MasterDataQuery); DataRow MasterDataDR = MasterDataDT.Rows[0]; if (MasterDataDR["StoreID"].ToString() == "0") { FormCreateStoreData formCreateStoreData = new FormCreateStoreData(); formCreateStoreData._StoreID = StoreID; formCreateStoreData.ShowDialog(); } else { string MasterDataUpdateQuery = "SELECT redStoreOverrideID FROM redStoreOverride WHERE redStoreID = " + StoreID; DataTable MasterDataUpdateDT = Catman_Class_Library.SqlFunctions_RedReport.GetData(MasterDataUpdateQuery); DataRow MasterDataUpdateDR = MasterDataUpdateDT.Rows[0]; FormUpdateStoreData formUpdateStoreData = new FormUpdateStoreData(); formUpdateStoreData._StoreID = MasterDataUpdateDR["redStoreOverrideID"].ToString(); formUpdateStoreData.ShowDialog(); } } else { FormViewStore viewStore = new FormViewStore(); viewStore._StoreID = Convert.ToInt32(StoreID); viewStore.ShowDialog(); } }