示例#1
0
        protected override void UpdateObject()
        {
            request = RequestServices.GetById(Parameters.Id);

            if (request != null)
            {
                if (!request.IsProvinceRequest)
                {
                    request.RequestContent = NoiDungChiDao.Text.Trim();
                    request.RequiredDate   = ThoiHan.Text.ToDateTime();
                    request.RequesterName  = LanhDaoYeuCau.SelectedItem.Text;
                }

                request.RequesterID = LanhDaoYeuCau.SelectedValue.ToInteger();

                RequestServices.Update(request, ChuyenVienTheoDoi.GetSelectedValues(), DonViThucHien.GetSelectedValues(), NguoiThucHien.GetSelectedValues(), XacNhanHoanThanh.Checked);

                ExceptionlessClient.Default.SubmitEvent(new Event {
                    Message = $"Cập nhật thông tin ykcd ({Sessions.DisplayName})", Type = "Cập nhật YKCD", Source = AppSettings.AGENCY_NAME
                });

                if (request.DocumentID > 0)
                {
                    Redirector.Redirect(ViewNames.Agency.ThongTinVanBan, "id", request.DocumentID);
                }
                else
                {
                    Redirector.Redirect(ViewNames.Agency.ThongTinYKCD, "id", request.RequestID);
                }
            }
        }
示例#2
0
        protected override void CreateNewObject()
        {
            request = new Request
            {
                DocumentID     = Parameters.Pid,
                RequestContent = NoiDungChiDao.Text.Trim(),
                RequiredDate   = ThoiHan.Text.ToDateTime(),
                RequesterID    = LanhDaoYeuCau.SelectedValue.ToInteger(),
                RequesterName  = LanhDaoYeuCau.SelectedItem.Text
            };

            RequestServices.Create(request, ChuyenVienTheoDoi.GetSelectedValues(), DonViThucHien.GetSelectedValues(), NguoiThucHien.GetSelectedValues(), XacNhanHoanThanh.Checked);

            ExceptionlessClient.Default.SubmitEvent(new Event {
                Message = $"Nhập thông tin ykcd mới ({Sessions.DisplayName})", Type = "Nhập YKCD", Source = AppSettings.AGENCY_NAME
            });

            if (request.DocumentID > 0)
            {
                Redirector.Redirect(ViewNames.Agency.ThongTinVanBan, "id", request.DocumentID);
            }
            else
            {
                Redirector.Redirect(ViewNames.Agency.ThongTinYKCD, "id", request.RequestID);
            }
        }