Exemple #1
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 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);
        }
        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);
        }
        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);
        }