Exemple #1
0
        private void SaveData()
        {
            clsDM_DonVi_KetQua cls = new clsDM_DonVi_KetQua();

            for (int i = fg.Rows.Fixed; i < fg.Rows.Count; i++)
            {
                if (fg.GetDataDisplay(i, "IsEdit") == "")
                {
                    continue;
                }
                cls.Ten_KetQua_DonVi = fg.GetDataDisplay(i, "Ten_KetQua_DonVi");
                cls.TonTai           = bool.Parse(fg.GetDataDisplay(i, "TonTai"));
                if (fg.GetDataDisplay(i, "IsEdit") == "0")
                {
                    cls.TonTai          = false;
                    cls.ID_DonVi_KetQua = fg.GetIntValue(i, "ID_DonVi_KetQua");
                    cls.Update();
                }
                else
                {
                    cls.TonTai = true;
                    if (fg.GetDataDisplay(i, "ID_DonVi_KetQua") == "")
                    {
                        cls.Insert();
                    }
                    else
                    {
                        cls.ID_DonVi_KetQua = fg.GetIntValue(i, "ID_DonVi_KetQua");
                        cls.Update();
                    }
                }
            }
            BaseMessages.ShowInformationMessage("Cập nhật thành công !");
        }
Exemple #2
0
        private void fg_KeyUp(object sender, KeyEventArgs e)
        {
            if (btnCapNhat.Visible)
            {
                return;
            }
            switch (e.KeyCode)
            {
            case Keys.Insert:
                fg.Rows.Add();
                fg.Rows[fg.Rows.Count - 1]["IsEdit"] = "1";
                fg.SetSTT();
                break;

            case Keys.Delete:
                if (fg.Row < fg.Rows.Fixed)
                {
                    BaseMessages.ShowInformationMessage("Chưa chọn ...");
                    return;
                }
                if (fg.GetDataDisplay(fg.Row, "ID_Kho") == "")
                {
                    fg.Rows.Remove(fg.Row);
                }
                else
                {
                    fg.Rows[fg.Row]["IsEdit"] = "0";
                    fg.Rows[fg.Row].Visible   = false;
                }
                fg.SetSTT();
                break;
            }
        }
Exemple #3
0
        private void SaveData()
        {
            clsDM_Kho cls = new clsDM_Kho();

            for (int i = fg.Rows.Fixed; i < fg.Rows.Count; i++)
            {
                if (fg.GetDataDisplay(i, "IsEdit").ToLower() == "")
                {
                    continue;
                }
                cls.Ten_Kho = fg.GetDataDisplay(i, "Ten_Kho");
                cls.SuDung  = fg.GetBoolValue(i, "SuDung");
                //delete
                if (fg.GetDataDisplay(i, "IsEdit") == "0")
                {
                    cls.ID_Kho = int.Parse(fg.GetDataDisplay(i, "ID_Kho"));
                    cls.TonTai = false;
                    cls.Update();
                }
                else if (fg.GetDataDisplay(i, "IsEdit") == "1")
                {
                    cls.TonTai = true;
                    if (fg.GetDataDisplay(i, "ID_Kho") == "")
                    {
                        cls.Insert();
                    }
                    else
                    {
                        cls.ID_Kho = int.Parse(fg.GetDataDisplay(i, "ID_Kho"));
                        cls.Update();
                    }
                }
            }
            BaseMessages.ShowInformationMessage("Cập nhật thành công!");
        }
Exemple #4
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            if (fgQD.Row < fgQD.Rows.Fixed)
            {
                BaseMessages.ShowInformationMessage("Chưa chọn quyết định.");
                return;
            }
            if (BaseMessages.ShowDeleteQuestionMessage() == DialogResult.No)
            {
                return;
            }

            clsQD_NhapVatTu cls = new clsQD_NhapVatTu();

            cls.ID_QuyetDinh = int.Parse(fgQD.GetDataDisplay(fgQD.Row, "ID_QuyetDinh"));
            cls.SelectOne();
            cls.TonTai = false;
            cls.Update();
            BaseMessages.ShowInformationMessage("Xóa thành công!");

            LockEdit(true);
            Loadfg();

            ResetTextboxs();
            fgChiTiet.Rows.Count = fgChiTiet.Rows.Fixed;
        }
Exemple #5
0
 private void SaveData()
 {
     if (!IsValid())
     {
         return;
     }
     if (cmbDonViTG.SelectedIndex == 0)
     {
         foreach (Control c in this.Controls)
         {
             if (c is CheckBox)
             {
                 CheckBox b = (CheckBox)c;
                 if (b.Checked)
                 {
                     m_strThu = b.Text.Split('T')[1] + "," + m_strThu;
                 }
             }
         }
     }
     thongSo.Clear();
     thongSo.Add(m_strThu);
     thongSo.Add(txtNgay.Text);
     thongSo.Add(txtThang.Text);
     thongSo.Add(dtTuGio.Value);
     thongSo.Add(dtDenGio.Value);
     BaseMessages.ShowInformationMessage("Lưu thành công");
     Visible = false;
 }
Exemple #6
0
        private void btnXoa_Click(object sender, System.EventArgs e)
        {
            DialogResult dg = BaseMessages.ShowQuestionMessage("Bạn có chắc chắn muốn xóa?");

            if (dg == DialogResult.Yes)
            {
                try
                {
                    clsPhieuXuat_ChiTiet cls0 = new clsPhieuXuat_ChiTiet();
                    cls0.ID_PhieuXuat = int.Parse(fgQDX[fgQDX.Row, "ID_PhieuXuat"].ToString());
                    cls0.DeleteWID_PhieuXuatLogic();
                    clsPhieuXuat_ChiTiet_TheKho cls1 = new clsPhieuXuat_ChiTiet_TheKho();
                    cls1.ID_PhieuXuat = int.Parse(fgQDX[fgQDX.Row, "ID_PhieuXuat"].ToString());
                    cls1.DeleteWID_PhieuXuatLogic();
                    clsQD_XuatVatTu cls = new clsQD_XuatVatTu();
                    cls.ID_PhieuXuat = int.Parse(fgQDX[fgQDX.Row, "ID_PhieuXuat"].ToString());
                    cls.Delete();
                    BaseMessages.ShowInformationMessage("Xóa thành công.");
                    Loadfg();
                }
                catch (Exception ex)
                {
                    BaseMessages.ShowErrorMessage("Lỗi" + ex.ToString());
                }
            }
        }
Exemple #7
0
 private void Delete_LoaiCongViec()
 {
     if (btnCapNhat.Visible)
     {
         BaseMessages.ShowInformationMessage("Bạn chưa ấn nút cập nhật nên không thể thực hiện chức năng này");
         return;
     }
     if (fg.Row < fg.Rows.Fixed || fg.Row > fg.Rows.Count)
     {
         BaseMessages.ShowInformationMessage("Chưa chọn loại công việc.");
         return;
     }
     if (fg.GetDataDisplay(fg.Row, "ID_LoaiCV") == "")
     {
         fg.Rows.Remove(fg.Row);
     }
     else
     {
         if (fg.Row < fg.Rows.Count - 1 && fg.Rows[fg.Row + 1].Node.Level > fg.Rows[fg.Row].Node.Level)
         {
             BaseMessages.ShowWarningMessage("Không được xóa công việc cha");
             return;
         }
         if (BaseMessages.ShowDeleteQuestionMessage() == DialogResult.Yes)
         {
             fg.Rows[fg.Row]["IsEdit"] = "0";
             fg.Rows[fg.Row].Visible   = false;
         }
     }
 }
        private void cmdDownload_Click(object sender, EventArgs e)
        {
            var fg = fgFile;

            if (fg.Row < fg.Rows.Fixed)
            {
                return;
            }

            SaveFileDialog oSaveFileDialog = new SaveFileDialog();

            oSaveFileDialog.InitialDirectory = @"C:\";
            oSaveFileDialog.FileName         = fg.GetDataDisplay(fg.Row, "FileName");
            oSaveFileDialog.Filter           = "Files| *." + fgFile.GetDataDisplay(fg.Row, "FileName").Substring(fg.GetDataDisplay(fg.Row, "FileName").LastIndexOf(".") + 1,
                                                                                                                 fg.GetDataDisplay(fg.Row, "FileName").Length - fg.GetDataDisplay(fg.Row, "FileName").LastIndexOf(".") - 1);
            if (oSaveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                int iID_Files = fg.GetIntValue(fg.Row, "ID_Files");
                System.IO.FileInfo fileInfo = new System.IO.FileInfo(oSaveFileDialog.FileName.ToString());
                bool bIsOverwrite           = oSaveFileDialog.OverwritePrompt;

                VSCM.Base.Forms.WaitForm.ShowSplashScreen();
                bool bDownloadSuccess = FTP_FilesManager.Download_TaiLieuDinhKem(iID_Files, fileInfo.DirectoryName, fileInfo.Name, bIsOverwrite);
                VSCM.Base.Forms.WaitForm.CloseForm();
                if (bDownloadSuccess)
                {
                    BaseMessages.ShowInformationMessage("Đã tải xong!");
                }
            }
        }
        private void cmdUpload_Click(object sender, EventArgs e)
        {
            if (cmbFiletype.Properties.GetIndexByKeyValue(cmbFiletype.EditValue) < 0)
            {
                BaseMessages.ShowWarningMessage("Chưa chọn loại file!");
                return;
            }

            if (txtFileName.Text == "")
            {
                BaseMessages.ShowWarningMessage("Chưa chọn file upload!");
                return;
            }

            System.IO.FileInfo fileInfo = new System.IO.FileInfo(txtFileName.Text.Trim());

            SplashForm.ShowSplashScreen();
            if (FTP_FilesManager.UpLoad_TaiLieu(m_PhanMem, (FTP_FilesManager.FTP_FileType)((Int16)cmbFiletype.EditValue), m_sFileIdentity, fileInfo.DirectoryName, fileInfo.Name, txtGhiChu.Text.Trim()))
            {
                SplashForm.CloseForm();
                BaseMessages.ShowInformationMessage("Upload file thành công!");
                Close();
                //txtGhiChu.Text = "";
                //txtFileName.Text = "";
                IsUpload = true;
            }
            else
            {
                SplashForm.CloseForm();
            }
        }
Exemple #10
0
        private void SaveData()
        {
            if (!IsValid())
            {
                return;
            }
            clsNhom cls = new clsNhom();

            cls.Ten_Nhom    = txtNhom.Text;
            cls.ID_Nhom_Cha = ((cmbNhomCha.EditValue ?? "").ToString() == "") ? SqlInt32.Null : Convert.ToInt32(cmbNhomCha.EditValue);
            cls.TonTai      = true;
            if (m_bCapNhat)
            {
                cls.ID_Nhom = m_iID_Nhom;
                cls.Update();
                BaseMessages.ShowInformationMessage("Cập nhật thành công !!!");
            }
            else
            {
                cls.Insert();
                BaseMessages.ShowInformationMessage("Thêm mới thành công !!!");
            }

            if (m_frmNhom_Ban != null)
            {
                m_frmNhom_Ban.LoadfgBan_Nhom();
            }
            Close();
        }
Exemple #11
0
 private void Delete_LoaiCongViec()
 {
     if (fg.Row < fg.Rows.Fixed || fg.Row > fg.Rows.Count)
     {
         BaseMessages.ShowInformationMessage("Chưa chọn loại công việc.");
         return;
     }
     if (fg.GetDataDisplay(fg.Row, "ID_LoaiCV") == "")
     {
         fg.Rows.Remove(fg.Row);
     }
     else
     {
         if (fg.Row < fg.Rows.Count - 1 && fg.Rows[fg.Row + 1].Node.Level > fg.Rows[fg.Row].Node.Level)
         {
             BaseMessages.ShowWarningMessage("Không được xóa công việc cha");
             return;
         }
         if (BaseMessages.ShowDeleteQuestionMessage() == DialogResult.Yes)
         {
             clsDM_LoaiCV cls = new clsDM_LoaiCV();
             cls.ID_LoaiCV = fg.GetIntValue(fg.Row, "ID_LoaiCV");
             cls.SelectOne();
             cls.TonTai = false;
             cls.Update();
             BaseMessages.ShowInformationMessage("Xóa thành công !!!");
         }
     }
 }
Exemple #12
0
 private void fgNS_Nhom_KeyUp(object sender, KeyEventArgs e)
 {
     if (btnCapNhat.Visible)
     {
         return;
     }
     if (fgNS_Nhom.Row < fgNS_Nhom.Rows.Fixed || fgNS_Nhom.Row > fgNS_Nhom.Rows.Count)
     {
         BaseMessages.ShowInformationMessage("Chưa chọn nhân sự !!!");
         return;
     }
     else
     {
         if (e.KeyCode == Keys.Delete)
         {
             if (fgNS_Nhom.GetDataDisplay(fgNS_Nhom.Row, "ID_NhanSu") == "")
             {
                 fgNS_Nhom.Rows.Remove(fgNS_Nhom.Row);
             }
             else
             {
                 fgNS_Nhom.Rows[fgNS_Nhom.Row].Visible   = false;
                 fgNS_Nhom.Rows[fgNS_Nhom.Row]["IsEdit"] = "0";
                 fgNS_Nhom.SetSTT();
             }
         }
     }
 }
Exemple #13
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            var fg = fgBan_Nhom;

            if (fg.Row < fg.Rows.Fixed || fg.Row > fg.Rows.Count)
            {
                BaseMessages.ShowInformationMessage("Chưa chọn nhóm.");
                return;
            }
            if (fg.GetDataDisplay(fg.Row, "ID_Nhom") == "")
            {
                fg.Rows.Remove(fg.Row);
            }
            else
            {
                if (fg.Row < fg.Rows.Count - 1 && fg.Rows[fg.Row + 1].Node.Level > fg.Rows[fg.Row].Node.Level)
                {
                    BaseMessages.ShowWarningMessage("Không được xóa nhóm cha");
                    return;
                }
                if (BaseMessages.ShowDeleteQuestionMessage() == DialogResult.Yes)
                {
                    clsNhom cls = new clsNhom();
                    cls.ID_Nhom = fg.GetIntValue(fg.Row, "ID_Nhom");
                    cls.SelectOne();
                    cls.TonTai = false;
                    cls.Update();
                    BaseMessages.ShowInformationMessage("Xóa thành công !!!");
                    LoadfgBan_Nhom();
                }
            }
        }
Exemple #14
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            if (fg.Row < fg.Rows.Fixed || fg.Rows[fg.Row].IsNode)
            {
                BaseMessages.ShowInformationMessage("Chọn dòng để sửa!");
                return;
            }
            if (BaseMessages.ShowDeleteQuestionMessage() == DialogResult.No)
            {
                return;
            }

            var cls = new clsPhanCapNhanVien();

            cls.ID_NguoiQuanLy = Convert.ToInt32(cmbNguoiQuanLy.EditValue);
            var items = cmbNhanVien.Properties.GetItems().GetCheckedValues();

            foreach (var item in items)
            {
                cls.ID_NhanVien = Convert.ToInt32(item);
            }
            cls.Delete();
            BaseMessages.ShowInformationMessage("Xóa thành công!");
            LockEdit(true);
            Loadfg();
            ResetComboboxs();
        }
Exemple #15
0
        private void btnGhiTheKho_Click(object sender, EventArgs e)
        {
            if (fgQD.Row < 0)
            {
                BaseMessages.ShowInformationMessage("Chưa chọn quyết định.");
                return;
            }
            if (int.Parse(fgQD[fgQD.Row, "TrangThai"].ToString()) == 5)
            {
                clsTheKho cls = new clsTheKho();
                cls.ID_PhieuNhap = Convert.ToInt32(fgQD.GetDataDisplay(fgQD.Row, "ID_QuyetDinh"));
                cls.TonTai       = true;
                for (int i = fgChiTiet.Rows.Fixed; i < fgChiTiet.Rows.Count; i++)
                {
                    if (fgChiTiet.GetBoolValue(i, "Chon"))
                    {
                        cls.ID_VatTu       = fgChiTiet.GetIntValue(i, "ID_VatTu");
                        cls.ID_Kho         = fgChiTiet.GetIntValue(i, "ID_Kho");
                        cls.SoLuong_BanDau = cls.SoLuong_HienTai = fgChiTiet.GetIntValue(i, "SoLuong");
                        cls.Insert();
                    }
                }

                Duyet("Bạn có chắc chắn muốn ghi thẻ kho?", 6, "Ghi thành công!");
                //BaseMessages.ShowInformationMessage("Cập nhật thành công!");
                Loadfg();
            }
            else
            {
                BaseMessages.ShowWarningMessage("Phiếu chưa được phê duyệt");
                return;
            }
        }
Exemple #16
0
        private void Duyet(string question, byte trangthai, string message)
        {
            if (fgQDX.Row < fgQDX.Rows.Fixed)
            {
                BaseMessages.ShowInformationMessage("Chưa chọn quyết định.");
                return;
            }
            if (MessageBox.Show(question, "Xác nhận", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            int  fgRow             = fgQDX.Row;
            byte previousTrangThai = Convert.ToByte(fgQDX[fgQDX.Row, "TrangThai"]);

            clsQD_XuatVatTu cls = new clsQD_XuatVatTu();

            cls.ID_PhieuXuat = int.Parse(fgQDX.GetDataDisplay(fgQDX.Row, "ID_PhieuXuat"));
            cls.SelectOne();
            cls.TrangThai = trangthai;
            cls.UpdateTrangThai();
            BaseMessages.ShowInformationMessage(message);
            if (trangthai == (int)GlobalVariables.TrangThai.TrinhDuyet)
            {
                fgQDX[fgQDX.Row, "Ten_TrangThai"] = "Trình duyệt";
                fgQDX[fgQDX.Row, "TrangThai"]     = 1;
                fgQDX.Rows[fgQDX.Row].Style       = cs2;
            }
            else if (trangthai == (int)GlobalVariables.TrangThai.HuyDuyet)
            {
                fgQDX[fgQDX.Row, "Ten_TrangThai"] = "Hủy duyệt";
                fgQDX[fgQDX.Row, "TrangThai"]     = 3;
                fgQDX.Rows[fgQDX.Row].Style       = cs3;
            }
            else if (trangthai == (int)GlobalVariables.TrangThai.PheDuyet)
            {
                fgQDX[fgQDX.Row, "Ten_TrangThai"] = "Phê duyệt";
                fgQDX[fgQDX.Row, "TrangThai"]     = 5;
                cls.ID_PhieuXuat   = int.Parse(fgQDX.GetDataDisplay(fgQDX.Row, "ID_PhieuXuat"));
                cls.Nguoi_PheDuyet = "Admin";
                cls.UpdateNguoiPheDuyet();
                fgQDX.Rows[fgQDX.Row].Style = cs4;
            }
            else if (trangthai == (int)GlobalVariables.TrangThai.GhiTheKho)
            {
                fgQDX[fgQDX.Row, "Ten_TrangThai"] = "Ghi thẻ kho";
                fgQDX[fgQDX.Row, "TrangThai"]     = 6;
                fgQDX.Rows[fgQDX.Row].Style       = cs5;
            }
            LockEdit(true);
            Lock(false, false, false, false, false, false);
            fgQDX.Row = -1;

            txtSoPhieuXuat.ResetText();
            fgChiTietXuat.Rows.Count = fgChiTietXuat.Rows.Fixed;

            //focus
            fgQDX.Row = fgRow;
        }
 private void SaveData()
 {
     if (!IsValid())
     {
         return;
     }
     BaseMessages.ShowInformationMessage("Lưu thành công");
     Close();
 }
Exemple #18
0
        private void Duyet(string question, byte trangthai, string message)
        {
            if (fgQD.Row < fgQD.Rows.Fixed)
            {
                BaseMessages.ShowInformationMessage("Chưa chọn quyết định.");
                return;
            }
            if (MessageBox.Show(question, "Xác nhận", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            int  fgRow             = fgQD.Row;
            byte previousTrangThai = Convert.ToByte(fgQD[fgQD.Row, "TrangThai"]);

            clsQD_NhapVatTu cls = new clsQD_NhapVatTu();

            cls.ID_QuyetDinh = int.Parse(fgQD.GetDataDisplay(fgQD.Row, "ID_QuyetDinh"));
            cls.SelectOne();
            cls.TrangThai = trangthai;
            cls.Update();
            BaseMessages.ShowInformationMessage(message);
            if (trangthai == 1)
            {
                fgQD[fgQD.Row, "Ten_TrangThai"] = "Trình duyệt";
                fgQD[fgQD.Row, "TrangThai"]     = 1;
                fgQD.Rows[fgQD.Row].Style       = cs2;
            }
            else if (trangthai == 3)
            {
                fgQD[fgQD.Row, "Ten_TrangThai"] = "Hủy duyệt";
                fgQD[fgQD.Row, "TrangThai"]     = 3;
                fgQD.Rows[fgQD.Row].Style       = cs3;
                CapNhatSLVatTuKhoVer2(Convert.ToInt32(fgQD.GetDataDisplay(fgQD.Row, "ID_QuyetDinh")), 3);
            }
            else if (trangthai == 5)
            {
                fgQD[fgQD.Row, "Ten_TrangThai"] = "Phê duyệt";
                fgQD[fgQD.Row, "TrangThai"]     = 5;
                fgQD.Rows[fgQD.Row].Style       = cs4;
            }
            else if (trangthai == 6)
            {
                fgQD[fgQD.Row, "Ten_TrangThai"] = "Ghi thẻ kho";
                fgQD[fgQD.Row, "TrangThai"]     = 6;
                fgQD.Rows[fgQD.Row].Style       = cs5;
                CapNhatSLVatTuKhoVer2(Convert.ToInt32(fgQD.GetDataDisplay(fgQD.Row, "ID_QuyetDinh")), 6);
            }
            LockEdit(true);
            Lock(false, false, false, false, false, false);
            fgQD.Row = -1;

            ResetTextboxs();
            fgChiTiet.Rows.Count = fgChiTiet.Rows.Fixed;
            //focus
            fgQD.Row = fgRow;
        }
Exemple #19
0
 private void btnSua_Click(object sender, EventArgs e)
 {
     if (fg.Row < fg.Rows.Fixed)
     {
         BaseMessages.ShowInformationMessage("Chưa chọn công việc.");
         return;
     }
     SendDataToFormThongTinCV();
 }
 private void btnSua_Click(object sender, EventArgs e)
 {
     if (fg.Row < fg.Rows.Fixed || fg.Rows[fg.Row].IsNode)
     {
         BaseMessages.ShowInformationMessage("Chọn dòng để sửa.");
         return;
     }
     m_bFlag = false;
     LockEdit(false);
 }
Exemple #21
0
 private void btnSua_Click(object sender, System.EventArgs e)
 {
     if (fgQDX.Row < 0)
     {
         BaseMessages.ShowInformationMessage("Chưa chọn quyết định.");
         return;
     }
     GlobalVariables.m_Flag = 1;
     LoadChiTiet("Sửa phiếu xuất chi tiết");
 }
Exemple #22
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (!IsValid())
     {
         return;
     }
     SaveData();
     BaseMessages.ShowInformationMessage("Cập nhật thành công!");
     LockEdit(true);
     LoadData();
 }
Exemple #23
0
 private void btnSua_Click(object sender, EventArgs e)
 {
     if (fgQD.Row < 0)
     {
         BaseMessages.ShowInformationMessage("Chưa chọn quyết định.");
         return;
     }
     m_blFlag = false;
     LockEdit(false);
     LockEditfgChiTiet(false);
     LoadfgChiTiet(int.Parse(fgQD.GetDataDisplay(fgQD.Row, "ID_QuyetDinh")), int.Parse(fgQD.GetDataDisplay(fgQD.Row, "ID_NhaCungCap")));
 }
Exemple #24
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            if (m_bFlag)
            {
                if (!IsValid())
                {
                    return;
                }

                clsKho_VatTu cls = new clsKho_VatTu();
                cls.ID_Kho = int.Parse("0" + cmbKho.EditValue);
                cls.DeleteWID_KhoLogic();

                for (int i = fg.Rows.Fixed; i < fg.Rows.Count; i++)
                {
                    if (fg.GetBoolValue(i, "Chon"))
                    {
                        cls.ID_VatTu = fg.GetIntValue(i, "ID_VatTu");
                        cls.SoLuong  = fg.GetIntValue(i, "SoLuong");
                        cls.Insert();
                    }
                }
                BaseMessages.ShowInformationMessage("Cập nhật thành công!");
                LockEdit(true);
                Loadfg();
                fg.Filter("Ten_Kho", cmbKho.GetValue("Ten_Kho"));
                fg.SetSTT();
            }
            else
            {
                if (!IsValidXuatKho())
                {
                    return;
                }
                clsKho_VatTu cls = new clsKho_VatTu();
                for (int i = fg.Rows.Fixed; i < fg.Rows.Count; i++)
                {
                    if (fg.GetBoolValue(i, "Chon"))
                    {
                        //Xuat Kho
                        cls.Xuat_Kho(Convert.ToInt32(fg[i, "ID_Kho"]), Convert.ToInt32(fg[i, "ID_VatTu"]),
                                     Convert.ToInt32(fg[i, "SoLuongXuat"]), Convert.ToInt32(fg[i, "ID_KhoXuat"]));
                    }
                }
                BaseMessages.ShowInformationMessage("Cập nhật thành công!");
                LockEdit(true);
                LockEditXuatKho(true);

                Loadfg();
                fg.Filter("Ten_Kho", cmbKho.GetValue("Ten_Kho"));
                fg.SetSTT();
            }
        }
Exemple #25
0
        private void Insert_LoaiCongViec()
        {
            if (btnCapNhat.Visible)
            {
                BaseMessages.ShowInformationMessage("Bạn chưa ấn nút cập nhật nên không thể thực hiện chức năng này ");
                return;
            }
            Row fgRow = fg.Rows.Add();

            fgRow["IsEdit"] = "1";
            fgRow["TonTai"] = true;
            fg.SetSTT();
        }
Exemple #26
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            int fgRow = 0;

            if (!IsValid() || !IsValidChiTiet())
            {
                return;
            }

            clsQD_NhapVatTu cls = new clsQD_NhapVatTu();

            cls.So_QuyetDinh   = txtSoQuyetDinh.Text.Trim();
            cls.Ngay_QuyetDinh = Convert.ToDateTime(dtmNgayQD.Value);
            cls.ID_NhaCungCap  = int.Parse(cmbNhaCungCap.EditValue.ToString());
            SqlDateTime currentDateTime = (new clsFunctions()).SelectCurrentDateTime();

            cls.TonTai = true;

            if (m_blFlag) //Them moi' quyet dinh
            {
                cls.NgayLap      = currentDateTime;
                cls.Ngay_SuaCuoi = currentDateTime;
                cls.TrangThai    = 0;
                cls.Insert();
                SaveDataChiTiet(int.Parse(cls.ID_QuyetDinh.ToString()));
            }
            else //Sua quyet dinh
            {
                fgRow            = fgQD.Row; //lưu lại vị trí dòng đang sửa
                cls.ID_QuyetDinh = Convert.ToInt32(fgQD.GetDataDisplay(fgQD.Row, "ID_QuyetDinh"));
                cls.Ngay_SuaCuoi = currentDateTime;
                cls.NgayLap      = Convert.ToDateTime(fgQD.GetData(fgQD.Row, "NgayLap"));
                cls.TrangThai    = Convert.ToByte(fgQD.GetDataDisplay(fgQD.Row, "TrangThai"));
                cls.Update();
                SaveDataChiTiet(int.Parse(cls.ID_QuyetDinh.ToString()));
            }

            BaseMessages.ShowInformationMessage("Cập nhật thành công!");
            LockEdit(true);
            LockEditfgChiTiet(true);
            Loadfg();

            ResetTextboxs();
            fgChiTiet.Rows.Count = fgChiTiet.Rows.Fixed;

            //option: focus vào dòng đã sửa
            if (!m_blFlag)
            {
                fgQD.Row = fgRow;
            }
        }
        private void SaveData()
        {
            var fg = fgHarvard;
            clsSoTayKinhNghiem cls = new clsSoTayKinhNghiem();

            for (int i = fg.Rows.Fixed; i < fg.Rows.Count; i++)
            {
                if (fg.GetDataDisplay(i, "IsEdit") == "")
                {
                    continue;
                }
                cls.Ngay_Thang     = DateTime.Parse(fg.GetDataDisplay(i, "Ngay_Thang"));
                cls.ID_BoPhan      = int.Parse(fg[i, "ID_BoPhan"] + "");
                cls.MoTa           = fg.GetDataDisplay(i, "MoTa");
                cls.MucDo_AnhHuong = fg.GetDataDisplay(i, "MucDo_AnhHuong");
                cls.NguyenNhan     = fg.GetDataDisplay(i, "NguyenNhan");
                cls.BienPhap       = fg.GetDataDisplay(i, "BienPhap");
                cls.GhiChu         = fg.GetDataDisplay(i, "GhiChu");
                cls.Ngay_Lap       = DateTime.Parse(fg.GetDataDisplay(i, "Ngay_Lap"));
                ///cls.ID_NguoiLap = int.Parse(fg.GetDataDisplay(i, "ID_NguoiLap"));
                cls.ID_NguoiLap = GlobalVariables.GetID_NhanSu();
                //Xóa
                if (fg.GetDataDisplay(i, "IsEdit") == "0")
                {
                    cls.ID_SoTay = int.Parse(fg[i, "ID_SoTay"].ToString());// dòng thứ i, cột ID_SoTay
                    cls.Update();
                }
                else
                {
                    if (fg.GetDataDisplay(i, "ID_SoTay") == "") //Thêm mới
                    {
                        cls.Insert();
                    }
                    else
                    {
                        cls.ID_SoTay = int.Parse(fg[i, "ID_SoTay"].ToString()); // Cập nhật
                        cls.Update();
                    }
                }
            }
            BaseMessages.ShowInformationMessage("Cập nhật thành công!");
        }
Exemple #28
0
 private void Delete_LoaiCongViec()
 {
     if (btnCapNhat.Visible)
     {
         BaseMessages.ShowInformationMessage("Bạn chưa ấn nút cập nhật nên không thể thực hiện chức năng này");
         return;
     }
     if (fg.Row < fg.Rows.Fixed || fg.Row > fg.Rows.Count)
     {
         BaseMessages.ShowInformationMessage("Chưa chọn đơn vị kết quả.");
         return;
     }
     if (fg.GetDataDisplay(fg.Row, "ID_KetQua_DonVi") == "")
     {
         fg.Rows.Remove(fg.Row);
     }
     fg.Rows[fg.Row]["IsEdit"] = "0";
     fg.Rows[fg.Row].Visible   = false;
     fg.SetSTT();
 }
Exemple #29
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            clsPhieuXuat cls = new clsPhieuXuat();

            cls.ID_Kho         = int.Parse(cboKhoXuat.EditValue.ToString());
            cls.Ngay_HachToan  = (DateTime)dtpNgayHachToan.Value;
            cls.So_PhieuXuat   = txtSoPhieuXuat.Text;
            cls.Ngay_XuatKho   = (DateTime)dtpNgayXuatKho.Value;
            cls.Ngay_Lap       = GlobalVariables.NgayLV;
            cls.Ngay_PheDuyet  = GlobalVariables.NgayLV;
            cls.Nguoi_Lap      = "ABC";
            cls.Nguoi_PheDuyet = "";
            cls.TrangThai      = 0;
            cls.TonTai         = true;
            if (IsValidPhieuXuat())
            {
                try
                {
                    if (GlobalVariables.m_Flag == 0)
                    {
                        cls.Insert();
                        SavePhieuChiTiet(int.Parse(cls.ID_PhieuXuat.ToString()));
                        SavePhieuChiTiet_TheKho(int.Parse(cls.ID_PhieuXuat.ToString()));
                    }
                    else
                    {
                        cls.Update();
                        SavePhieuChiTiet(m_iID_PX);
                        SavePhieuChiTiet_TheKho(m_iID_PX);
                    }
                    BaseMessages.ShowInformationMessage("Cập nhật thành công.");
                    m_dtTmp.Dispose();
                    this.Close();
                    GlobalVariables.m_Flag = 100;
                }
                catch (Exception ex)
                {
                    BaseMessages.ShowErrorMessage(ex.ToString());
                }
            }
        }
Exemple #30
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            if (fg.Row < fg.Rows.Fixed)
            {
                BaseMessages.ShowInformationMessage("Chưa chọn công việc!");
                return;
            }
            if (BaseMessages.ShowDeleteQuestionMessage() == DialogResult.No)
            {
                return;
            }
            clsCongViec cls = new clsCongViec();

            cls.ID_CongViec = Convert.ToInt32(fg[fg.Row, "ID_CongViec"]);
            cls.TonTai      = false;
            cls.Update();

            BaseMessages.ShowInformationMessage("Xóa thành công!");
            Loadfg();
            fg.ApplyFilters();
        }