Exemplo n.º 1
0
        protected override void BindValueToPageControls()
        {
            foreach (var user in UserServices.GetList(new[] { UserRole.LanhDaoDonVi, UserRole.LanhDaoVP }))
            {
                LanhDaoYeuCau.AddSelectItem(user.FullName, user.UserID.ToString(), user.DepartmentName?.ToUpper());
            }

            foreach (var user in UserServices.GetList())
            {
                NguoiThucHien.AddSelectItem(user.FullName, user.UserID.ToString(), user.DepartmentName + " .");
            }

            ChuyenVienTheoDoi.BindData(UserServices.GetList(new[] { UserRole.ChuyenVienVP, UserRole.ChuyenVien, UserRole.TruongPhongBan, UserRole.Administrator, UserRole.LanhDaoVP }).ToList <object>(), "UserID", "FullName", "DepartmentName");
            DonViThucHien.BindData(DepartmentServices.GetList().ToList <object>(), "DepartmentID", "DepartmentName", "DepartmentGroupName");
        }
Exemplo n.º 2
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);
                }
            }
        }
Exemplo n.º 3
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);
            }
        }