Exemple #1
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            long id = TextUtils.ToInt64(grvData.GetFocusedRowCellValue(colID));

            if (id == 0)
            {
                return;
            }

            DesignSummaryModel model = (DesignSummaryModel)DesignSummaryBO.Instance.FindByPK(id);

            if (model.UpdatedBy != Global.AppUserName)
            {
                MessageBox.Show("Bạn không có quyền xóa THTK này.", TextUtils.Caption,
                                MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            if (model.IsApproved)
            {
                MessageBox.Show("Tổng hợp thiết kế đã được duyệt.\n Bạn không thể xóa được.", TextUtils.Caption,
                                MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            DialogResult result = MessageBox.Show("Bạn có chắc muốn xóa tổng hợp thiết kế này?", TextUtils.Caption,
                                                  MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                DesignSummaryBO.Instance.Delete(id);
                grvData.DeleteSelectedRows();
            }
        }
Exemple #2
0
        private void hủyDuyệtToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có chắc muốn hủy duyệt những THTK này?", TextUtils.Caption, MessageBoxButtons.YesNo,
                                MessageBoxIcon.Question) == DialogResult.Yes)
            {
                foreach (int i in grvData.GetSelectedRows())
                {
                    if (i < 0)
                    {
                        continue;
                    }
                    int iD = TextUtils.ToInt(grvData.GetRowCellValue(i, colID));
                    if (iD == 0)
                    {
                        continue;
                    }

                    DesignSummaryModel model = (DesignSummaryModel)DesignSummaryBO.Instance.FindByPK(iD);
                    if (model.IsApproved)
                    {
                        model.IsApproved = false;
                        DesignSummaryBO.Instance.Update(model);
                        grvData.SetFocusedRowCellValue(colIsApproved, false);
                    }
                }
                loadData(cboYear.Text);
            }

            MessageBox.Show("Hủy duyệt thành công!", TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Exemple #3
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            long id = TextUtils.ToInt64(grvData.GetFocusedRowCellValue(colID));

            if (id == 0)
            {
                return;
            }
            DesignSummaryModel model = (DesignSummaryModel)DesignSummaryBO.Instance.FindByPK(id);

            //if (model.UpdatedBy != Global.AppUserName)
            //{
            //    MessageBox.Show("Bạn không có quyền sửa THTK này.", TextUtils.Caption,
            //       MessageBoxButtons.OK, MessageBoxIcon.Stop);
            //    return;
            //}

            frmDesignSummary frm = new frmDesignSummary();

            frm.DesignSummary   = model;
            frm.LoadDataChange += main_LoadDataChange;
            frm.Show();
        }
 protected DesignSummaryFacade(DesignSummaryModel model) : base(model)
 {
 }