Пример #1
0
        private void KetChuyen_Delete()
        {
            dgvKetChuyen.EndEdit();
            bdsKetChuyen.EndEdit();

            //if (Common.GetPartitionCurrent() != 0 && Common.GetPartitionCurrent() != Element.sysWorkingYear)
            //{
            //    Common.MsgCancel("Phải chuyển về phân vùng dữ liệu " + Element.sysWorkingYear.ToString() + "!");
            //    return;
            //}

            //frmKetChuyen_Run frm = new frmKetChuyen_Run();
            //frm.Tag = "Ket_Chuyen_Delete";
            //frm.numThang1.Value = Element.sysNgay_Ct1.Month;
            //frm.numThang2.Value = Element.sysNgay_Ct2.Month;

            //frm.Load();
            //if (!frm.isAccept)
            //    return;

            //DateTime dteNgay_Ct1 = Library.StrToDate("01/" + frm.numThang1.Value + "/" + Element.sysWorkingYear);
            //DateTime dteNgay_Ct2 = Library.StrToDate("01/" + frm.numThang2.Value + "/" + Element.sysWorkingYear);
            //dteNgay_Ct2 = dteNgay_Ct2.AddMonths(1).AddDays(-1);

            EpointProcessBox.setMaxValue(dgvKetChuyen.Rows.Count);

            if (!Common.CheckDataLocked(dteNgay_Ct1))
            {
                //Common.MsgCancel("Dữ liệu đã khóa, liên hệ với nhà quản trị!");
                EpointProcessBox.AddMessage(EpointMessage.GetMessage("DATALOCK"));
                return;
            }

            foreach (DataRow dr in dtKetChuyen.Rows)
            {
                if ((bool)dr["SELECT"] == false)
                {
                    continue;
                }

                Hashtable ht = new Hashtable();
                ht["NGAY_CT1"] = dteNgay_Ct1;
                ht["NGAY_CT2"] = dteNgay_Ct2;
                ht["STT"]      = dr["Stt"];
                ht["MA_CT"]    = "TD";
                ht["MA_DVCS"]  = Element.sysMa_DvCs;

                //Common.ShowStatus(Languages.GetLanguage("In_Process") + (string)dr["Dien_Giai"]);
                EpointProcessBox.AddMessage(Languages.GetLanguage("In_Process") + (string)dr["Dien_Giai"]);

                SQLExec.Execute("Sp_KetChuyen_Delete", ht, CommandType.StoredProcedure);

                dr["Select"] = false;
            }

            //Common.EndShowStatus();
            //Common.MsgOk(Languages.GetLanguage("End_Process"));
            EpointProcessBox.AddMessage(Languages.GetLanguage("End_Process"));
        }