Esempio n. 1
0
        private void LoadItem()
        {
            var id      = Request["ID"];
            var dynamic = dynamicService.GenericService.GetModel(id);

            if (dynamic == null)
            {
                Response.Write("未能获取数据,该数据可能已被删除!");
                Response.End();
            }

            if (!string.IsNullOrEmpty(dynamic.IndexImgUrl))
            {
                imgUpload.ImageUrl = dynamic.IndexImgUrl;
                imgUpload.Visible  = true;
            }

            txtTitle.Text           = dynamic.Title;
            labPublisher.Text       = dynamic.Publisher;
            editorContent.InnerText = dynamic.Content;
            txtPulishTime.Text      = dynamic.CreateTime.ToString(DZAFCPortal.Config.Base.NewsDataFormate);
            //txtSummary.Text = dynamic.Summary;
            dropType.SelectedValue = dropType.Items.FindByValue(dynamic.CategoryID).Value;
            txtOrderNum.Text       = dynamic.OrderNum.ToString();
            //checkboxType.SelectedValue = checkboxType.Items.FindByValue(dynamic.CategoryID).Value;
            labType.Text = dropType.Items[dropType.SelectedIndex].Text;
            //加载附件
            UploadAttach.GetAttachAndBind(id);
        }
Esempio n. 2
0
        public void EFamilyShow(string id)
        {
            bool update = false;
            var  ee     = onlineService.GenericService.GetModel(id);
            var  option = optionService.GenericService.GetAll().Where(p => p.NY_OnlineVoteID == id).OrderBy(p => p.CreateTime).ToList();

            txtName.Text    = ee.Title;
            txtSummary.Text = ee.Summary;
            if (!string.IsNullOrEmpty(ee.ImageURL))
            {
                imgUpload.ImageUrl = ee.ImageURL;
                imgUpload.Visible  = true;
            }
            beginTime.Value         = (ee.BeginTime.ToString("yyyy-MM-dd HH:mm")).ToString();
            endTime.Value           = (ee.EndTime.ToString("yyyy-MM-dd HH:mm")).ToString();
            txtPublishDept.Text     = ee.PublishDept;
            txtActDescription.Value = ee.OnlineDescription;
            if (DateTime.Now > ee.BeginTime)
            {
                update = true;
            }
            if (update)
            {
                dropOnline.Enabled = false;
            }
            dropOnline.SelectedIndex   = option.Count - 1;
            dropNum.SelectedIndex      = ee.VoteNum - 1;
            dropVoteType.SelectedValue = ee.VoteType;
            dropdownList(option, update);
            //加载附件
            UploadAttach.GetAttachAndBind(id);
        }
        private void LoadItem()
        {
            var employee = employeeInforService.GenericService.GetModel(ItemID);

            if (employee == null)
            {
                Response.Write("未能获取数据,该数据可能已被删除!");
                Response.End();
            }
            txtName.Text          = userService.getUserName(employee.NameAccount);
            dropSex.SelectedValue = employee.Sex.ToString();
            if (employee.BirthDate != null)
            {
                txtBirthDate.Text = DateTime.Parse(employee.BirthDate.ToString()).ToString("yyyy-MM-dd");
            }
            txtDeptName.Text = userService.getUserDepName(employee.NameAccount);
            txtPosition.Text = employee.Position;
            dropRecruitNature.SelectedValue = employee.RecruitNature;
            dropEducation.SelectedValue     = employee.Education;
            dropZZMM.SelectedValue          = employee.PoliticalStatus;

            txtEducationalLevel.Text = employee.EducationalLevel;
            txtGraduatedSchool.Text  = employee.GraduatedSchool;
            txtProfession.Text       = employee.Profession;
            if (employee.GraduationTime != null)
            {
                txtGraduationTime.Text = DateTime.Parse(employee.GraduationTime.ToString()).ToString("yyyy-MM-dd");
            }
            if (employee.GraduatesCheckTime != null)
            {
                txtGraduatesCheckTime.Text = DateTime.Parse(employee.GraduatesCheckTime.ToString()).ToString("yyyy-MM-dd");
            }
            if (employee.InternshipStartTime != null)
            {
                txtInternshipStartTime.Text = DateTime.Parse(employee.InternshipStartTime.ToString()).ToString("yyyy-MM-dd");
            }
            if (employee.InternshipEndTime != null)
            {
                txtInternshipEndTime.Text = DateTime.Parse(employee.InternshipEndTime.ToString()).ToString("yyyy-MM-dd");
            }
            if (employee.TrialStartTime != null)
            {
                txtTrialStartTime.Text = DateTime.Parse(employee.TrialStartTime.ToString()).ToString("yyyy-MM-dd");
            }
            if (employee.TrialEndTime != null)
            {
                txtTrialEndTime.Text = DateTime.Parse(employee.TrialEndTime.ToString()).ToString("yyyy-MM-dd");
            }
            dropEnable.SelectedValue = employee.Enable.ToString();
            if (employee.OutdutyDate.HasValue)
            {
                txtOutdutyDate.Text = employee.OutdutyDate.Value.ToString("yyyy-MM-dd");
            }
            txtOrderNum.Text = employee.OrderNum.ToString();
            //加载附件
            UploadAttach.GetAttachAndBind(ItemID);
        }
Esempio n. 4
0
        private void Save()
        {
            try
            {
                if (!String.IsNullOrEmpty(Request["ID"]))
                {
                    var item = GetEditItem(dropType.SelectedValue);
                    dynamicService.GenericService.Update(item);

                    //保存附件
                    UploadAttach.SaveAttach(item.ID);
                }
                else
                {
                    var item2 = GetNewItem(dropType.SelectedValue);
                    dynamicService.GenericService.Add(item2);

                    UMS_Message um = CreateUMS_Message(item2);
                    if (um != null)
                    {
                        umsSercice.AddMessage(um);
                    }
                    //保存附件
                    UploadAttach.SaveAttach(item2.ID);
                    for (int i = 0; i < checkboxType.Items.Count; i++)
                    {
                        if (checkboxType.Items[i].Selected)
                        {
                            var item = GetNewItem(checkboxType.Items[i].Value);
                            dynamicService.GenericService.Add(item);

                            //保存附件
                            UploadAttach.SaveAttach(item.ID);
                        }
                    }
                }
                dynamicService.GenericService.Save();
                Fxm.Utility.Page.JsHelper.CloseWindow(false, "数据保存成功!", "refresh();");
            }
            catch (Exception ex)
            {
                Fxm.Utility.Page.MessageBox.Show("发生未处理异常,请重试!");

                NySoftland.Core.Log4.LogHelper.Error("保存行内动态异常!", ex);
            }
        }
Esempio n. 5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string id = Request["id"];

            try
            {
                var eventSolicitation = CreateNewPrefer();
                if (!string.IsNullOrEmpty(id))
                {
                    onlineService.GenericService.Update(eventSolicitation);
                    onlineService.GenericService.Save();
                    var ee = onlineService.GenericService.GetModel(id);
                    if (DateTime.Now < ee.BeginTime)
                    {
                        DeleteOteOptions(id);
                        VoteAdd(eventSolicitation);
                    }
                    //保存附件
                    UploadAttach.SaveAttach(eventSolicitation.ID);
                }
                else
                {
                    onlineService.GenericService.Add(eventSolicitation);
                    onlineService.GenericService.Save();
                    VoteAdd(eventSolicitation);
                    //保存附件
                    UploadAttach.SaveAttach(eventSolicitation.ID);

                    UMS_Message um = CreateUMS_Message(eventSolicitation);
                    umsSercice.AddMessage(um);
                }
                //Fxm.Utility.Page.MessageBox.Show("保存成功!");
                //ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>RefreshParent();</script>");
                Fxm.Utility.Page.JsHelper.CloseWindow(false, "数据保存成功!", "refresh();");
            }
            catch (Exception ex)
            {
                Fxm.Utility.Page.MessageBox.Show("保存过程发生错误,请重试!");

                //记录错误日志
                NySoftland.Core.Log4.LogHelper.Error("在线评选添加异常[PreferentActionAdd.aspx]", ex);
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(ItemID))
                {
                    int count = employeeInforService.GenericService.GetAll(p => p.NameAccount == selectApplyMan.Value).Count();
                    if (count > 0)
                    {
                        Fxm.Utility.Page.MessageBox.Show("用户已存在!");
                        return;
                    }
                }
                var employee = GetNewItem();
                if (!string.IsNullOrEmpty(ItemID))
                {
                    employeeInforService.GenericService.Update(employee);
                }
                else
                {
                    employeeInforService.GenericService.Add(employee);
                }
                //保存附件
                UploadAttach.SaveAttach(employee.ID);
                employeeInforService.GenericService.Save();
                //Fxm.Utility.Page.JsHelper.CloseWindow(false, "数据保存成功!", "refresh()");
                Fxm.Utility.Page.MessageBox.Show("保存成功!");
                ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>RefreshParent();</script>");
            }
            catch (Exception ex)
            {
                Fxm.Utility.Page.MessageBox.Show("保存过程发生错误,请重试!");

                //记录错误日志
                NySoftland.Core.Log4.LogHelper.Error("转正申请添加异常[EmployeeInforEdit.aspx]", ex);
            }
        }
        private void LoadItem()
        {
            var id       = ItemID;
            var employee = employeeInforService.GenericService.GetModel(id);
            var ds       = userService.GenericService.GetAll().Distinct()
                           .Select(c => new { Account = c.Account, DisplayName = c.Account + "_" + c.DisplayName }).OrderBy(c => c.Account).ToList();
            var appindex = ds.FindIndex(c => c.Account == employee.NameAccount);

            if (employee == null)
            {
                Response.Write("未能获取数据,该数据可能已被删除!");
                Response.End();
            }
            selectApplyMan.SelectedIndex = appindex;
            txtName.Text          = userService.getUserName(employee.NameAccount);
            dropSex.SelectedValue = employee.Sex.ToString();
            if (employee.BirthDate != null)
            {
                txtBirthDate.Text = DateTime.Parse(employee.BirthDate.ToString()).ToString("yyyy-MM-dd");
            }
            txtDeptName1.Value = userService.getUserDepName(employee.NameAccount);
            txtPosition.Text   = employee.Position;
            dropRecruitNature.SelectedValue = employee.RecruitNature;
            dropEducation.SelectedValue     = employee.Education;
            dropZZMM.SelectedValue          = employee.PoliticalStatus;
            txtEducationalLevel.Text        = employee.EducationalLevel;
            txtGraduatedSchool.Text         = employee.GraduatedSchool;
            txtProfession.Text = employee.Profession;
            if (employee.GraduationTime != null)
            {
                txtGraduationTime.Text = DateTime.Parse(employee.GraduationTime.ToString()).ToString("yyyy-MM-dd");
            }
            if (employee.GraduatesCheckTime != null)
            {
                txtGraduatesCheckTime.Text = DateTime.Parse(employee.GraduatesCheckTime.ToString()).ToString("yyyy-MM-dd");
            }
            if (employee.InternshipStartTime != null)
            {
                txtInternshipStartTime.Text = DateTime.Parse(employee.InternshipStartTime.ToString()).ToString("yyyy-MM-dd");
            }
            if (employee.InternshipEndTime != null)
            {
                txtInternshipEndTime.Text = DateTime.Parse(employee.InternshipEndTime.ToString()).ToString("yyyy-MM-dd");
            }
            if (employee.TrialStartTime != null)
            {
                txtTrialStartTime.Text = DateTime.Parse(employee.TrialStartTime.ToString()).ToString("yyyy-MM-dd");
            }
            if (employee.TrialEndTime != null)
            {
                txtTrialEndTime.Text = DateTime.Parse(employee.TrialEndTime.ToString()).ToString("yyyy-MM-dd");
            }

            dropEnable.SelectedValue = employee.Enable.ToString();

            if (employee.OutdutyDate.HasValue)
            {
                txtOutdutyDate.Text = employee.OutdutyDate.Value.ToString("yyyy-MM-dd");
            }
            txtOrderNum.Text = employee.OrderNum.ToString();
            //加载附件
            UploadAttach.GetAttachAndBind(id);
        }