public override void MergeID() { if (bdsDoiTuongNh.Count <= 0) { return; } drCurrent = ((DataRowView)bdsDoiTuongNh.Current).Row; string strOldValue = (string)drCurrent["Ma_Nh_Dt"]; frmMergeID frm = new frmMergeID(); frm.Load("LIDOITUONGNH", "Ma_Nh_Dt", "Ten_Nh_Dt", strOldValue, "DoiTuongNh"); if (frm.isAccept) { string strNewValue = frm.strNewValue; string strMsg = Element.sysLanguage == enuLanguageType.English ? "Do you want to merge " + strOldValue + " to " + strNewValue + " ?" : "Bạn có muốn gộp mã " + strOldValue + " sang " + strNewValue + " không ?"; if (!Common.MsgYes_No(strMsg)) { return; } if (DataTool.SQLMergeID("Ma_Nh_Dt", "LIDOITUONGNH", strOldValue, strNewValue)) { bdsDoiTuongNh.RemoveCurrent(); bdsDoiTuongNh.Position = bdsDoiTuongNh.Find("Ma_Nh_Dt", strNewValue); } } }
public override void MergeID() { if (bdsTuyen.Count <= 0) { return; } drCurrent = ((DataRowView)bdsTuyen.Current).Row; string strOldValue = (string)drCurrent["Ma_Tuyen"]; frmMergeID frm = new frmMergeID(); frm.Load("LITUYEN", "Ma_Tuyen", "Ten_Tuyen", strOldValue, "TUYENBH"); if (frm.isAccept) { string strNewValue = frm.strNewValue; string strMsg = Element.sysLanguage == enuLanguageType.English ? "Do you want to merge {" + strOldValue + "} to {" + strNewValue + "}?" : "Bạn có muốn gộp mã {" + strOldValue + "} sang {" + strNewValue + "} không ?"; if (!Common.MsgYes_No(strMsg)) { return; } if (DataTool.SQLMergeID("Ma_Tuyen", "LITUYEN", strOldValue, strNewValue)) { bdsTuyen.RemoveCurrent(); bdsTuyen.Position = bdsTuyen.Find("Ma_Tuyen", strNewValue); } } }
public override void MergeID() { if (bdsBoPhan.Count <= 0) { return; } drCurrent = ((DataRowView)bdsBoPhan.Current).Row; string strOldValue = (string)drCurrent["Ma_Bp"]; frmMergeID frm = new frmMergeID(); frm.Load("LIBOPHAN", "Ma_Bp", "Ten_Bp", strOldValue, "BoPhan"); if (frm.isAccept) { string strNewValue = frm.strNewValue; string strMsg = Element.sysLanguage == enuLanguageType.English ? "Do you want to merge {" + strOldValue + "} to {" + strNewValue + "}?" : "Bạn có muốn gộp mã {" + strOldValue + "} sang {" + strNewValue + "} không ?"; if (!Common.MsgYes_No(strMsg)) { return; } if (DataTool.SQLMergeID("Ma_Bp", "LIBOPHAN", strOldValue, strNewValue)) { ////Sync data------------- //string Is_Sync = Convert.ToString(SQLExec.ExecuteReturnValue("SELECT Parameter_Value FROM SYSPARAMETER WHERE Parameter_ID = 'SYNC_BEGIN'")); //if (Is_Sync == "1") //{ // SqlConnection sqlCon = SQLExecSync1.GetNewSQLConnectionSync1(); // if (sqlCon.State != ConnectionState.Open) // { // SQLExec.Execute("UPDATE SYSPARAMETER SET Parameter_Value = 0 WHERE Parameter_ID = 'SYNC_BEGIN'"); // string strMsg1 = Element.sysLanguage == enuLanguageType.Vietnamese ? "Quá trình đồng bộ đang bị gián đoạn. Vui lòng chờ trong ít phút !" : "The synchronization process is interrupted. Please wait a few minutes !"; // Common.MsgCancel(strMsg1); // } // else // { // DataToolSync1.SQLMergeID("Ma_Bp", "LIBOPHAN", strOldValue, strNewValue); // } //} ////---------------------- //Cập nhật History htHistory["CODE"] = drCurrent[strCode]; htHistory["NAME"] = drCurrent[strName]; htHistory["UPDATE_TYPE"] = "M"; UpdateHistory(); bdsBoPhan.RemoveCurrent(); bdsBoPhan.Position = bdsBoPhan.Find("Ma_Bp", strNewValue); } } }