コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            var dManager = new DepartmentManager();
            var departments = dManager.FetchAll();
            DDLDepartments.DataSource = departments;
            DDLDepartments.DataTextField = "Description";
            DDLDepartments.DataValueField = "Id";
            DDLDepartments.DataBind();

            switch (Mode)
            {
                case Transaction.TransactionMode.UpdateEntry:
                    txtItemTypeCode.Text = ItemType.ItemTypeCode;
                    txtItemTypeDescription.Text = ItemType.ItemDesciption;
                    DDLDepartments.SelectedValue = ItemType.DepartmentId.ToString();
                    btnDelete.Visible = true;
                    break;
                case Transaction.TransactionMode.ViewDetail:
                    btnDelete.Visible = false;
                    btnSave.Visible = false;
                    break;
                case Transaction.TransactionMode.NewEntry:
                    txtItemTypeCode.Text = Transaction.TransactionType.ITTY + "-" + _itemTypeManager.ReferenceNumber + 1;
                    break;
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            var dManager = new DepartmentManager();
            var departments = dManager.FetchAll();
            DDLDepartments.DataSource = departments;
            DDLDepartments.DataTextField = "Description";
            DDLDepartments.DataValueField = "Id";
            DDLDepartments.DataBind();

            switch (Mode)
            {
                case Transaction.TransactionMode.UpdateEntry:
                    txtContactPerson.Text = Supplier.ContactPerson;
                    txtEmailAddress.Text = Supplier.EmailAddress;
                    txtFaxNumber.Text = Supplier.FaxNumber;
                    txtSupplierAddress.Text = Supplier.Address;
                    txtSupplierCode.Text = Supplier.Code;
                    txtSupplierName.Text = Supplier.Name;
                    txtTelephoneNumber.Text = Supplier.TelephoneNumber;
                    btnDelete.Visible = true;
                    DDLDepartments.SelectedValue = Supplier.DepartmentId.ToString();
                    chkIsConsignment.Checked = Supplier.IsConsignment;
                    break;
                case Transaction.TransactionMode.NewEntry:
                    txtSupplierCode.Text = Transaction.TransactionType.SUPP + "-Auto";
                    break;
            }
        }
コード例 #3
0
ファイル: Default.aspx.cs プロジェクト: jonbacud/Development
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DepartmentManager dm = new DepartmentManager();
                //gvDepartments.DataSource = dm.FetchAll();
                //gvDepartments.DataBind();

            }
        }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack) return;
     var dManager = new DepartmentManager();
     var departments = dManager.FetchAll();
     DDLDepartments.DataSource = departments;
     DDLDepartments.DataTextField = "Description";
     DDLDepartments.DataValueField = "Id";
     DDLDepartments.DataBind();
     if (ShelfId>0)
     {
         txtShelfCode.Text = Shelf.Code;
         txtShelfDescription.Text = Shelf.Description;
         DDLDepartments.SelectedValue = Shelf.DepartmentId.ToString();
         btnDelete.Visible = true;
     }
 }
コード例 #5
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            _nodeId      = TranslateUtils.ToInt(Request.QueryString["NodeID"]);
            _idArrayList = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);

            if (!IsPostBack)
            {
                divAddDepartment.Attributes.Add("onclick", ModalGovInteractDepartmentSelect.GetOpenWindowString(PublishmentSystemId, _nodeId));
                ltlDepartmentName.Text = DepartmentManager.GetDepartmentName(Body.AdministratorInfo.DepartmentId);
                ltlUserName.Text       = Body.AdministratorInfo.DisplayName;
            }
        }
コード例 #6
0
ファイル: AdminManager.cs プロジェクト: yuxi214/siteservercms
 public static string GetFullName(string userName)
 {
     if (!string.IsNullOrEmpty(userName))
     {
         var adminInfo = GetAdminInfo(userName);
         if (adminInfo != null)
         {
             string retval         = $"账号:{userName}<br />姓名:{adminInfo.DisplayName}";
             var    departmentName = DepartmentManager.GetDepartmentName(adminInfo.DepartmentId);
             if (!string.IsNullOrEmpty(departmentName))
             {
                 retval += $"<br />部门:{departmentName}";
             }
             return(retval);
         }
         return(userName);
     }
     return(string.Empty);
 }
コード例 #7
0
        public void UpdateDepartmentTestTooLongDescription()
        {
            IDepartmentManager departmentManager = new DepartmentManager(_departmentAccessor);
            Department         department        = new Department
            {
                DepartmentID = "Fake Department",
                Description  = "Fake Description"
            };
            Department anotherDepartment = new Department
            {
                DepartmentID = "Fake Department",
                Description  = "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" +
                               "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
            };

            bool result = departmentManager.EditDepartment(department, anotherDepartment);

            Assert.AreEqual(false, result);
        }
コード例 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            msgLabel.Text = "";
            try
            {
                departmentDropDownList.DataTextField  = "DepartmentCode";
                departmentDropDownList.DataValueField = "departmentId";
                examSelectDropDownList.DataTextField  = "ExaminationType";
                examSelectDropDownList.DataValueField = "ExaminationId";

                if (!IsPostBack)
                {
                    aStudent = new Student();
                    ViewState["RegistationNo"] = "";
                    ViewState["Certificates"]  = certificates;
                    Session["aStudent"]        = aStudent;
                    DepartmentManager aDepartmentManager = new DepartmentManager();
                    departments = aDepartmentManager.GetAllDepartments();
                    ExaminationManager anExaminationManager = new ExaminationManager();
                    examinations = anExaminationManager.GetAllExaminations();
                    examSelectDropDownList.DataSource = examinations;
                    examSelectDropDownList.DataBind();
                    departmentDropDownList.DataSource = departments;
                    departmentDropDownList.DataBind();
                }
            }
            catch (SqlException sqlException)
            {
                msgLabel.ForeColor = Color.Red;
                msgLabel.Text      = "Database error.See details error: " + sqlException.Message;
            }
            catch (Exception exception)
            {
                msgLabel.ForeColor = Color.Red;
                string errorMessage = "Unknow error occured.";
                errorMessage += exception.Message;
                if (exception.InnerException != null)
                {
                    errorMessage += exception.InnerException.Message;
                }
                msgLabel.Text = errorMessage;
            }
        }
コード例 #9
0
        public ActionResult Create()
        {
            DepartmentManager departmentManager = new DepartmentManager();

            ViewBag.Departments = departmentManager.GetAll();

            DevisionManager devisionManager = new DevisionManager();

            ViewBag.Devisions = devisionManager.GetAll();

            //DistrictManager districtManager = new DistrictManager();
            //ViewBag.Districts = districtManager.GetAll();

            //ThanaManager thanaManager = new ThanaManager();
            //ViewBag.Thanas = thanaManager.GetAll();


            return(View());
        }
コード例 #10
0
        public void BindGrid()
        {
            try
            {
                var departmentIdList = BaiRongDataProvider.DepartmentDao.GetDepartmentIdListByFirstDepartmentIdList(GovPublicManager.GetFirstDepartmentIdList(PublishmentSystemInfo));
                if (departmentIdList.Count == 0)
                {
                    departmentIdList = DepartmentManager.GetDepartmentIdList();
                }

                rptContents.DataSource     = departmentIdList;
                rptContents.ItemDataBound += rptContents_ItemDataBound;
                rptContents.DataBind();
            }
            catch (Exception ex)
            {
                PageUtils.RedirectToErrorPage(ex.Message);
            }
        }
コード例 #11
0
        public void Update(DepartmentInfo departmentInfo)
        {
            var updateParms = new IDataParameter[]
            {
                GetParameter(ParmName, EDataType.NVarChar, 255, departmentInfo.DepartmentName),
                GetParameter(ParmCode, EDataType.VarChar, 50, departmentInfo.Code),
                GetParameter(ParmParentsPath, EDataType.NVarChar, 255, departmentInfo.ParentsPath),
                GetParameter(ParmParentsCount, EDataType.Integer, departmentInfo.ParentsCount),
                GetParameter(ParmChildrenCount, EDataType.Integer, departmentInfo.ChildrenCount),
                GetParameter(ParmIsLastNode, EDataType.VarChar, 18, departmentInfo.IsLastNode.ToString()),
                GetParameter(ParmSummary, EDataType.NVarChar, 255, departmentInfo.Summary),
                GetParameter(ParmCountOfAdmin, EDataType.Integer, departmentInfo.CountOfAdmin),
                GetParameter(ParmId, EDataType.Integer, departmentInfo.DepartmentId)
            };

            ExecuteNonQuery(SqlUpdate, updateParms);

            DepartmentManager.ClearCache();
        }
コード例 #12
0
        public ActionResult DeleteFromDash(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Error500", "Home", null));
            }
            DepartmentManager departmentManager = db.DepartmentManagers.Find(id);

            if (departmentManager == null)
            {
                return(HttpNotFound());
            }
            User user = db.Users.Find(departmentManager.UserId);

            db.DepartmentManagers.Remove(departmentManager);
            db.Users.Remove(user);
            db.SaveChanges();
            return(RedirectToAction("Management", "Organisations", null));
        }
コード例 #13
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                if (_departmentId == 0)
                {
                    var departmentInfo = new DepartmentInfo();
                    departmentInfo.DepartmentName = DepartmentName.Text;
                    departmentInfo.Code           = Code.Text;
                    departmentInfo.ParentId       = TranslateUtils.ToInt(ParentID.SelectedValue);
                    departmentInfo.Summary        = Summary.Text;

                    BaiRongDataProvider.DepartmentDao.Insert(departmentInfo);
                }
                else
                {
                    var departmentInfo = DepartmentManager.GetDepartmentInfo(_departmentId);

                    departmentInfo.DepartmentName = DepartmentName.Text;
                    departmentInfo.Code           = Code.Text;
                    departmentInfo.ParentId       = TranslateUtils.ToInt(ParentID.SelectedValue);
                    departmentInfo.Summary        = Summary.Text;

                    BaiRongDataProvider.DepartmentDao.Update(departmentInfo);
                }

                Body.AddAdminLog("维护部门信息");

                SuccessMessage("部门设置成功!");
                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, "部门设置失败!");
            }

            if (isChanged)
            {
                PageUtils.CloseModalPageAndRedirect(Page, _returnUrl);
            }
        }
コード例 #14
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _contentId = TranslateUtils.ToInt(Request.QueryString["ContentID"]);

            if (!IsPostBack)
            {
                if (_contentId > 0)
                {
                    var logInfoArrayList = DataProvider.GovInteractLogDao.GetLogInfoArrayList(PublishmentSystemId, _contentId);
                    var builder          = new StringBuilder();

                    var count = logInfoArrayList.Count;
                    var i     = 1;
                    foreach (GovInteractLogInfo logInfo in logInfoArrayList)
                    {
                        if (logInfo.DepartmentID > 0)
                        {
                            builder.Append(
                                $@"<tr class=""info""><td class=""center""> {DepartmentManager.GetDepartmentName(
                                    logInfo.DepartmentID)} {EGovInteractLogTypeUtils.GetText(logInfo.LogType)}<br />{DateUtils
                                    .GetDateAndTimeString(logInfo.AddDate)} </td></tr>");
                        }
                        else
                        {
                            builder.Append(
                                $@"<tr class=""info""><td class=""center""> {EGovInteractLogTypeUtils.GetText(
                                    logInfo.LogType)}<br />{DateUtils.GetDateAndTimeString(logInfo.AddDate)} </td></tr>");
                        }
                        if (i++ < count)
                        {
                            builder.Append(@"<tr><td class=""center""><img src=""../pic/flow.gif"" /></td></tr>");
                        }
                    }
                    ltlFlows.Text = builder.ToString();
                }
            }
        }
コード例 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            msgLabel.Text = "";
            try
            {
                departmentDropDownList.DataTextField  = "DepartmentCode";
                departmentDropDownList.DataValueField = "departmentId";
                semesterDropDownList.DataTextField    = "SemesterName";
                semesterDropDownList.DataValueField   = "SemesterId";
                if (!IsPostBack)
                {
                    List <Department> departments = new List <Department>();
                    List <Semester>   semester    = new List <Semester>();
                    aDepartmentManager = new DepartmentManager();
                    departments        = aDepartmentManager.GetAllDepartments();
                    SemesterManager aSemesterManager = new SemesterManager();
                    semester = aSemesterManager.GetAllSemesters();
                    departmentDropDownList.DataSource = departments;
                    departmentDropDownList.DataBind();
                    semesterDropDownList.DataSource = semester;
                    semesterDropDownList.DataBind();
                    GetAllUnscheduleCourses();
                }
            }

            catch (SqlException sqlException)
            {
                msgLabel.ForeColor = Color.Red;
                msgLabel.Text      = "Database error.See details error: " + sqlException.Message;
            }
            catch (Exception exception)
            {
                msgLabel.ForeColor = Color.Red;
                string errorMessage = "Unknow error occured.";
                errorMessage += exception.Message;
                if (exception.InnerException != null)
                {
                    errorMessage += exception.InnerException.Message;
                }
                msgLabel.Text = errorMessage;
            }
        }
コード例 #16
0
        public GovInteractContentInfo GetContentInfo(PublishmentSystemInfo publishmentSystemInfo, int nodeId, NameValueCollection form)
        {
            var queryCode      = GovInteractApplyManager.GetQueryCode();
            var departmentId   = TranslateUtils.ToInt(form[GovInteractContentAttribute.DepartmentId]);
            var departmentName = string.Empty;

            if (departmentId > 0)
            {
                departmentName = DepartmentManager.GetDepartmentName(departmentId);
            }

            var ipAddress = PageUtils.GetIpAddress();

            var contentInfo = new GovInteractContentInfo();

            contentInfo.PublishmentSystemId = publishmentSystemInfo.PublishmentSystemId;
            contentInfo.NodeId         = nodeId;
            contentInfo.DepartmentName = departmentName;
            contentInfo.QueryCode      = queryCode;
            contentInfo.State          = EGovInteractState.New;
            contentInfo.AddUserName    = string.Empty;
            contentInfo.IpAddress      = ipAddress;
            contentInfo.AddDate        = DateTime.Now;

            var relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(publishmentSystemInfo.PublishmentSystemId, nodeId);

            InputTypeParser.AddValuesToAttributes(ETableStyle.GovInteractContent, publishmentSystemInfo.AuxiliaryTableForGovInteract, publishmentSystemInfo, relatedIdentities, form, contentInfo.Attributes);

            //foreach (string name in form.AllKeys)
            //{
            //    if (!GovInteractContentAttribute.HiddenAttributes.Contains(name.ToLower()))
            //    {
            //        string value = form[name];
            //        if (!string.IsNullOrEmpty(value))
            //        {
            //            applyInfo.SetExtendedAttribute(name, value);
            //        }
            //    }
            //}

            return(contentInfo);
        }
コード例 #17
0
        public void Page_Load(object sender, EventArgs e)
        {
            _channelId = Utils.ToInt(Request.QueryString["channelId"]);
            _contentId = Utils.ToInt(Request.QueryString["contentId"]);

            _contentInfo = Main.ContentApi.GetContentInfo(SiteId, _channelId, _contentId);
            _adminInfo   = Main.AdminApi.GetAdminInfoByUserId(AuthRequest.AdminId);

            if (!IsPostBack)
            {
                LtlDepartmentName.Text = DepartmentManager.GetDepartmentName(_adminInfo.DepartmentId);
                LtlUserName.Text       = _adminInfo.DisplayName;

                var replyInfo = ReplyDao.GetReplyInfoByContentId(SiteId, _contentId);
                if (replyInfo != null)
                {
                    TbReply.Text = replyInfo.Reply;
                }
            }
        }
コード例 #18
0
        public ActionResult Index(int?p, string searchString, string currentFilter)
        {
            var list = DepartmentManager.GetAllEntities();

            if (searchString != null)
            {
                p = 1;
            }
            else
            {
                searchString = currentFilter;
            }
            ViewBag.CurrentFilter = searchString;
            list = list.Where(e => string.IsNullOrEmpty(searchString) || e.Name.Contains(searchString));
            list = list.OrderBy(e => e.Name);
            var pagesize = 5;
            var page     = p ?? 1;

            return(View(list.ToPagedList(page, pagesize)));
        }
コード例 #19
0
        public ActionResult Save(Teacher teacher)
        {
            ViewBag.DepartmentList  = DepartmentManager.GetAllDepartments();
            ViewBag.DesignationList = DesignationManager.GetAllDesignation();

            if (ModelState.IsValid)
            {
                string message = TeacherManager.Save(teacher);

                ViewBag.Message = message;
            }

            else
            {
                string message = "Validation error";
                ViewBag.Message = message;
            }

            return(View());
        }
コード例 #20
0
ファイル: SA3.cs プロジェクト: roberchenc/imagemanage
        private void deleteDepartment_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem lvi in LvsModifyDeportments.SelectedItems) //选中项遍历
            {
                LvsModifyDeportments.Items.RemoveAt(lvi.Index);              // 按索引移除
                //listView1.Items.Remove(lvi);   //按项移除
                //MessageBox.Show(lvi.SubItems[1].Text);
                MessageBox.Show("删除之后将不能恢复,确定要删除?");
                DepartmentManager dManager = new DepartmentManager();
                Department        temp     = new Department();
                temp.DepartmentName   = lvi.SubItems[1].Text;
                temp.DepartmentNumber = lvi.SubItems[2].Text;


                if (dManager.RemoveDepartment(temp))
                {
                    MessageBox.Show("删除成功");
                }
            }
        }
コード例 #21
0
        public void Page_Load(object sender, EventArgs e)
        {
            _additional.Add("UrlFormatString", PageUtils.GetAdminUrl(nameof(ModalDepartmentSelect), null));

            if (!IsPostBack)
            {
                if (Body.IsQueryExists("DepartmentID"))
                {
                    var    departmentId   = Body.GetQueryInt("DepartmentID");
                    var    departmentName = DepartmentManager.GetDepartmentName(departmentId);
                    string scripts        = $"window.parent.showCategoryDepartment('{departmentName}', '{departmentId}');";
                    PageUtils.CloseModalPageWithoutRefresh(Page, scripts);
                }
                else
                {
                    ClientScriptRegisterClientScriptBlock("NodeTreeScript", DepartmentTreeItem.GetScript(EDepartmentLoadingType.DepartmentSelect, _additional));
                    BindGrid();
                }
            }
        }
コード例 #22
0
 public void setManager(DepartmentManager manager)
 {
     this.manager = manager;
     columnTypes  = new Dictionary <string, Type>()
     {
         { "School", Type.CATEGORIC },
         { "Sex", Type.CATEGORIC },
         { "Age", Type.NUMERIC },
         { "Address", Type.CATEGORIC },
         { "Family size", Type.CATEGORIC },
         { "Parents status", Type.CATEGORIC },
         { "Mother's education", Type.NUMERIC },
         { "Father's education", Type.NUMERIC },
         { "Mother's job", Type.CATEGORIC },
         { "Father's job", Type.CATEGORIC },
         { "Reason", Type.CATEGORIC },
         { "Guardian", Type.CATEGORIC },
         { "Travel time", Type.NUMERIC },
         { "Study time", Type.NUMERIC },
         { "Failures", Type.NUMERIC },
         { "School support", Type.CATEGORIC },
         { "Family support", Type.CATEGORIC },
         { "Extra paid classes", Type.CATEGORIC },
         { "Extra activities", Type.CATEGORIC },
         { "Nursery", Type.CATEGORIC },
         { "Higher education", Type.CATEGORIC },
         { "Internet access", Type.CATEGORIC },
         { "Romantic relationship", Type.CATEGORIC },
         { "Family relation", Type.NUMERIC },
         { "Free time", Type.NUMERIC },
         { "Go out", Type.NUMERIC },
         { "Weekday alcohol", Type.NUMERIC },
         { "Weekend alcohol", Type.NUMERIC },
         { "Health", Type.NUMERIC },
         { "Absences", Type.NUMERIC },
         { "Grade 1", Type.NUMERIC },
         { "Grade 2", Type.NUMERIC },
         { "Grade 3", Type.NUMERIC },
     };
     PortuTable.DataSource = manager.GetTable();
 }
コード例 #23
0
        public ActionResult SaveTeacher(Teacher aTeacher)
        {
            DesignationManager aDesignationManager = new DesignationManager();
            DepartmentManager  aDepartmentManager  = new DepartmentManager();
            TeacherManager     aTeacherManager     = new TeacherManager();

            ViewBag.designations = aDesignationManager.GetAllDesignations();
            ViewBag.departments  = aDepartmentManager.GetAllDepartmentInfo();

            List <Teacher> aList        = aTeacherManager.GetAllTeachers();
            var            teacheremail = aList.FirstOrDefault(e => e.Email == aTeacher.Email);

            if (aTeacher.CreditTobeTaken < 0 || teacheremail != null)
            {
                if (aTeacher.CreditTobeTaken < 0 && teacheremail != null)
                {
                    ViewBag.message = "Credit must contain a non-negative value And Email Already Exist";
                }
                else if (aTeacher.CreditTobeTaken < 0)
                {
                    ViewBag.message = "Credit must contain a non-negative value";
                }
                else if (teacheremail != null)
                {
                    ViewBag.message = "Email Already Exist";
                }
            }
            else
            {
                if (aTeacherManager.SaveTeacher(aTeacher) > 0)
                {
                    ViewBag.message = "Teacher Saved Successfully";
                }
                else
                {
                    ViewBag.message = "Save Failed";
                }
            }

            return(View());
        }
コード例 #24
0
        public ActionResult SaveCourse(Course aCourse)
        {
            DepartmentManager aDepartmentManager = new DepartmentManager();
            SemesterManager   aSemesterManager   = new SemesterManager();

            ViewBag.departments = aDepartmentManager.GetAllDepartmentInfo();
            ViewBag.semesters   = aSemesterManager.GetAllSemester();
            CourseManager aCourseManager = new CourseManager();

            List <Course> alist      = aCourseManager.GetAllCourse();
            var           coursecode = alist.FirstOrDefault(c => c.Code == aCourse.Code);
            var           coursename = alist.FirstOrDefault(n => n.Name == aCourse.Name);

            if (coursecode != null || coursename != null)
            {
                if (coursecode != null && coursename != null)
                {
                    ViewBag.message = "Code and Name Already Exist";
                }
                else if (coursecode != null)
                {
                    ViewBag.message = "Code Already Exist";
                }
                else
                {
                    ViewBag.message = "Name Already Exist";
                }
            }
            else
            {
                if (aCourseManager.SaveCourse(aCourse) > 0)
                {
                    ViewBag.message = "Course Saved Successfully";
                }
                else
                {
                    ViewBag.message = "Save Failed";
                }
            }
            return(View());
        }
コード例 #25
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                var switchToDepartmentID = TranslateUtils.ToInt(Request.Form["switchToDepartmentID"]);
                if (switchToDepartmentID == 0)
                {
                    FailMessage("转办失败,必须选择转办部门");
                    return;
                }
                var switchToDepartmentName = DepartmentManager.GetDepartmentName(switchToDepartmentID);

                foreach (int applyID in _idArrayList)
                {
                    var state = DataProvider.GovPublicApplyDao.GetState(applyID);
                    if (state != EGovPublicApplyState.Denied && state != EGovPublicApplyState.Checked)
                    {
                        DataProvider.GovPublicApplyDao.UpdateDepartmentId(applyID, switchToDepartmentID);

                        var remarkInfo = new GovPublicApplyRemarkInfo(0, PublishmentSystemId, applyID, EGovPublicApplyRemarkType.SwitchTo, tbSwitchToRemark.Text, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now);
                        DataProvider.GovPublicApplyRemarkDao.Insert(remarkInfo);

                        GovPublicApplyManager.LogSwitchTo(PublishmentSystemId, applyID, switchToDepartmentName, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                    }
                }

                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, ex.Message);
                isChanged = false;
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page, "alert(\'申请转办成功!\');");
            }
        }
コード例 #26
0
        public ActionResult Edit(int id)
        {
            var student = studentManager.GetSingleRow(id);

            ViewBag.Id           = student.Id;
            ViewBag.Name         = student.Name;
            ViewBag.DepartmentId = student.DepartmentId;

            var departmentManager = new DepartmentManager();

            ViewBag.Departments = departmentManager.GetAll();

            List <Department> department = departmentManager.GetSingleRow(Convert.ToInt32(student.DepartmentId));

            foreach (var dept in department)
            {
                ViewBag.Department = dept.Name;
            }

            List <Devision> devisions = new DevisionManager().GetAll();

            ViewBag.Divisions = devisions;

            Devision devision = new DevisionManager().GetSingleDivision(student.DivisionId);

            ViewBag.DivisionId = devision.Id;
            ViewBag.Division   = devision.Name;

            District district = new DistrictManager().GetSinlgleDistrict(student.DistrictId);

            ViewBag.DistrictId = district.Id;
            ViewBag.District   = district.Name;

            Thana thana = new ThanaManager().GetSingleThana(student.ThanaId);

            ViewBag.ThanaId = thana.Id;
            ViewBag.Thana   = thana.Name;


            return(View());
        }
コード例 #27
0
 public string GetScriptOnLoad(int currentDepartmentID)
 {
     if (currentDepartmentID != 0)
     {
         var departmentInfo = DepartmentManager.GetDepartmentInfo(currentDepartmentID);
         if (departmentInfo != null)
         {
             var path = string.Empty;
             if (departmentInfo.ParentsCount <= 1)
             {
                 path = currentDepartmentID.ToString();
             }
             else
             {
                 path = departmentInfo.ParentsPath.Substring(departmentInfo.ParentsPath.IndexOf(",") + 1) + "," + currentDepartmentID.ToString();
             }
             return(DepartmentTreeItem.GetScriptOnLoad(path));
         }
     }
     return(string.Empty);
 }
コード例 #28
0
        public void UpdateDepartmentTest()
        {
            string deptName       = "deptName1";
            string deptNameUpdate = "deptNameUpdated";

            Assert.True(DbContext.Departments.Count() == 0);

            DepartmentManager.AddDepartment(deptName);
            Assert.True(DbContext.Departments.Count() == 1);

            var dept = DepartmentManager.GetDepartmentByName(deptName);

            Assert.Equal(dept.DepartmentName, deptName);

            dept.DepartmentName = deptNameUpdate;
            DepartmentManager.UpdateDepartmemt(dept);

            var updated = DepartmentManager.GetDepartmentByName(deptNameUpdate);

            Assert.Equal(updated.DepartmentName, deptNameUpdate);
        }
コード例 #29
0
        public static string GetApplyRemark(int applyID)
        {
            var remarkBuilder       = new StringBuilder();
            var remarkInfoArrayList = DataProvider.GovPublicApplyRemarkDao.GetRemarkInfoArrayList(applyID);

            foreach (GovPublicApplyRemarkInfo remarkInfo in remarkInfoArrayList)
            {
                if (!string.IsNullOrEmpty(remarkInfo.Remark))
                {
                    remarkBuilder.Append(
                        $@"<span style=""color:gray;"">{DepartmentManager.GetDepartmentName(remarkInfo.DepartmentID)}({remarkInfo
                            .UserName}){EGovPublicApplyRemarkTypeUtils.GetText(remarkInfo.RemarkType)}意见: </span><br />{StringUtils
                            .MaxLengthText(remarkInfo.Remark, 25)}<br />");
                }
            }
            if (remarkBuilder.Length > 0)
            {
                remarkBuilder.Length -= 6;
            }
            return(remarkBuilder.ToString());
        }
コード例 #30
0
        public IHttpActionResult List()
        {
            try
            {
                var request = Context.AuthenticatedRequest;
                var siteId  = request.GetQueryInt("siteId");
                if (!request.IsAdminLoggin || !request.AdminPermissions.HasSitePermissions(siteId, ApplicationUtils.PluginId))
                {
                    return(Unauthorized());
                }

                return(Ok(new
                {
                    Value = DepartmentManager.GetDepartmentInfoList(siteId)
                }));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
コード例 #31
0
        public IEnumerable <SelectListItem> GetAllDepartmentList()
        {
            List <SelectListItem> departmentLists = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Text = "---Select---", Value = ""
                },
            };
            List <Department> deptList = new DepartmentManager().GetAllDepartments();

            foreach (Department department in deptList)
            {
                SelectListItem dept = new SelectListItem();
                dept.Text  = department.DeptName;
                dept.Value = department.Id.ToString();
                departmentLists.Add(dept);
            }

            return(departmentLists);
        }
コード例 #32
0
 public ActionResult Create([Bind(Include = "DepartmentManagerId,UserId,DepartmentId,Position")] WeFix.WebUI.Models.DashboardViewModel departmentManager, FormCollection collection)
 {
     try
     {
         int               deptId  = Convert.ToInt32(collection.Get("deptId"));
         string            userId  = Convert.ToString(collection.Get("ManagerUserId"));
         DepartmentManager deptMan = new DepartmentManager()
         {
             DepartmentId = deptId,
             Position     = departmentManager.Position,
             UserId       = userId
         };
         db.DepartmentManagers.Add(deptMan);
         db.SaveChanges();
         return(RedirectToAction("Management", "Organisations", null));
     }
     catch
     {
         return(RedirectToAction("Management", "Organisations", null));
     }
 }
コード例 #33
0
ファイル: Test_Departments.cs プロジェクト: tm011064/Luputa
        internal IDepartmentModel Create(IDataStore dataStore, IApplicationSettings applicationSettings, IApplication application
                                         , DummyDataManager dtm, Random random)
        {
            DepartmentManager manager = new DepartmentManager(dataStore);

            IDepartmentModel department = new DepartmentModel(
                application.ApplicationId
                , "DepartmentName" + random.Next(1000000, 10000000));

            PopulateWithRandomValues(department, dtm, random);

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.Create(application.ApplicationId, department);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);

            IDepartmentModel dsDepartmentModel = manager.GetDepartment(department.ApplicationId, department.DepartmentId);

            Assert.IsNotNull(dsDepartmentModel);

            return(dsDepartmentModel);
        }
コード例 #34
0
 public string GetScriptOnLoad(int currentDepartmentId)
 {
     if (currentDepartmentId != 0)
     {
         var departmentInfo = DepartmentManager.GetDepartmentInfo(currentDepartmentId);
         if (departmentInfo != null)
         {
             string path;
             if (departmentInfo.ParentsCount <= 1)
             {
                 path = currentDepartmentId.ToString();
             }
             else
             {
                 path = departmentInfo.ParentsPath.Substring(departmentInfo.ParentsPath.IndexOf(",", StringComparison.Ordinal) + 1) + "," + currentDepartmentId;
             }
             return(DepartmentTreeItem.GetScriptOnLoad(path));
         }
     }
     return(string.Empty);
 }
コード例 #35
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            var dManager = new DepartmentManager();
            var departments = dManager.FetchAll();
            DDLDepartments.DataSource = departments;
            DDLDepartments.DataTextField = "Description";
            DDLDepartments.DataValueField = "Id";
            DDLDepartments.DataBind();

            switch (Mode)
            {
                case Transaction.TransactionMode.NewEntry:
                    break;
                case Transaction.TransactionMode.UpdateEntry:
                     txtCategoryCode.Text = Category.Code;
                    txtCategoryName.Text = Category.Description;
                    DDLDepartments.SelectedValue =          Category.DepartmentId.ToString();
                    btnDelete.Enabled = true;
                    btnDelete.Visible = true;
                    break;
            }
        }