private void initialPage() { DataTable dt = Extenders.ObtainDataTableFromIEnumerable(objInfo.SearchData()); //searchResult = objInfo.SearchData(); gvJob.DataSource = dt; gvJob.DataBind(); m_template template = new m_template(); var data = template.SelectAllByActive();//.SelectAllByActiveForConvertPage(Convert.ToInt16(dt.Rows[0]["spec_id"].ToString())); ddlTemplate.Items.Clear(); ddlTemplate.DataSource = data; ddlTemplate.DataBind(); ddlTemplate.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, "")); ddlTemplate.SelectedValue = ""; switch (CommandName) { case CommandNameEnum.ConvertTemplate: fillinScreen(); ddlTemplate.Enabled = true; btnSave.Enabled = true; btnCancel.Enabled = true; pUploadfile.Visible = false; break; } }
private void initialPage() { lbCommandName.Text = CommandName.ToString(); m_specification specification = new m_specification(); ddlSpecification.Items.Clear(); ddlSpecification.DataSource = specification.SelectAll(); ddlSpecification.DataBind(); ddlSpecification.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, "")); m_template template = new m_template(); ddlPathUrl.Items.Clear(); ddlPathUrl.DataSource = template.SelectAllByActive(); ddlPathUrl.DataBind(); ddlPathUrl.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, "")); switch (CommandName) { case CommandNameEnum.Add: ddlSpecification.Enabled = true; txtPrefix.Enabled = true; txtName.Enabled = true; btnSave.Enabled = true; btnCancel.Enabled = true; break; case CommandNameEnum.Edit: fillinScreen(); ddlSpecification.Enabled = true; txtPrefix.Enabled = true; txtName.Enabled = true; btnSave.Enabled = true; btnCancel.Enabled = true; break; case CommandNameEnum.View: fillinScreen(); ddlSpecification.Enabled = false; txtPrefix.Enabled = false; txtName.Enabled = false; btnSave.Enabled = false; btnCancel.Enabled = true; break; } }
protected void Page_Load(object sender, EventArgs e) { SearchJobRequest prvPage = Page.PreviousPage as SearchJobRequest; this.PreviousPath = Constants.LINK_SEARCH_JOB_REQUEST; if (!Page.IsPostBack) { this.selectedList = new List <int>(); this.selectedList = prvPage.selectedList; this.isPoGroupOperation = prvPage.isPoGroupOperation; this.isChangeDueDateGroup = prvPage.isDuedateGroupOperation; this.isInvoiceGroupOperation = prvPage.isInvoiceGroupOperation; this.dataList = job_sample.FindAllByIds(this.selectedList); ddlAssignTo.Items.Clear(); ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.LOGIN_SELECT_SPEC), Convert.ToInt32(StatusEnum.LOGIN_SELECT_SPEC) + "")); ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.CHEMIST_TESTING), Convert.ToInt32(StatusEnum.CHEMIST_TESTING) + "")); ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.SR_CHEMIST_CHECKING), Convert.ToInt32(StatusEnum.SR_CHEMIST_CHECKING) + "")); ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.ADMIN_CONVERT_WORD), Convert.ToInt32(StatusEnum.ADMIN_CONVERT_WORD) + "")); ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.LABMANAGER_CHECKING), Convert.ToInt32(StatusEnum.LABMANAGER_CHECKING) + "")); ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.ADMIN_CONVERT_PDF), Convert.ToInt32(StatusEnum.ADMIN_CONVERT_PDF) + "")); m_template template = new m_template(); var data = template.SelectAllByActive(); ddlTemplate.Items.Clear(); ddlTemplate.DataSource = data; ddlTemplate.DataBind(); ddlTemplate.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, "")); ddlTemplate.SelectedValue = ""; pLogin.Visible = false; pChemist.Visible = false; pSrChemist.Visible = false; pRemark.Visible = false; pDisapprove.Visible = false; pAccount.Visible = false; pChangeDueDate.Visible = false; pAccount2.Visible = false; RoleEnum userRole = (RoleEnum)Enum.Parse(typeof(RoleEnum), userLogin.role_id.ToString(), true); switch (userRole) { case RoleEnum.LOGIN: pLogin.Visible = true; pShowChemistFileUpload.Visible = false; pChemist.Visible = false; pSrChemist.Visible = false; pRemark.Visible = false; pDisapprove.Visible = false; pAccount.Visible = false; pChangeDueDate.Visible = false; pAccount2.Visible = false; lbDesc.Text = "Login: ทำรายการแบบกลุ่ม"; break; case RoleEnum.CHEMIST: pLogin.Visible = false; pShowChemistFileUpload.Visible = false; pChemist.Visible = true; pSrChemist.Visible = false; pRemark.Visible = false; pDisapprove.Visible = false; pAccount.Visible = false; pChangeDueDate.Visible = false; pAccount2.Visible = false; lbDesc.Text = "Chemist: ทำรายการแบบกลุ่ม"; break; case RoleEnum.SR_CHEMIST: pLogin.Visible = false; ddlStatus.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.SR_CHEMIST_APPROVE), Convert.ToInt32(StatusEnum.SR_CHEMIST_APPROVE) + "")); ddlStatus.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.SR_CHEMIST_DISAPPROVE), Convert.ToInt32(StatusEnum.SR_CHEMIST_DISAPPROVE) + "")); pShowChemistFileUpload.Visible = false; pChemist.Visible = false; pSrChemist.Visible = !isChangeDueDateGroup; pRemark.Visible = false; pDisapprove.Visible = false; pAccount.Visible = false; pChangeDueDate.Visible = isChangeDueDateGroup; pAccount2.Visible = false; lbDesc.Text = "Sr.Chemist: ทำรายการแบบกลุ่ม"; break; case RoleEnum.LABMANAGER: pLogin.Visible = false; ddlStatus.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.LABMANAGER_APPROVE), Convert.ToInt32(StatusEnum.LABMANAGER_APPROVE) + "")); ddlStatus.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.LABMANAGER_DISAPPROVE), Convert.ToInt32(StatusEnum.LABMANAGER_DISAPPROVE) + "")); pShowChemistFileUpload.Visible = false; pChemist.Visible = false; pSrChemist.Visible = false; pRemark.Visible = false; pDisapprove.Visible = false; pAccount.Visible = false; pChangeDueDate.Visible = false; pAccount2.Visible = false; lbDesc.Text = "Lab Mnager: ทำรายการแบบกลุ่ม"; break; case RoleEnum.ADMIN: pLogin.Visible = false; pShowChemistFileUpload.Visible = false; pChemist.Visible = false; pSrChemist.Visible = false; pRemark.Visible = false; pDisapprove.Visible = false; //Boolean isChangePo = this.dataList.Exists(x => x.job_status == Convert.ToInt16(StatusEnum.JOB_COMPLETE)|| x.job_status == Convert.ToInt16(StatusEnum.LOGIN_SELECT_SPEC)); pChangeDueDate.Visible = isChangeDueDateGroup; pAccount.Visible = this.isPoGroupOperation; pAccount2.Visible = false; lbDesc.Text = "Admin: ทำรายการแบบกลุ่ม"; break; case RoleEnum.ACCOUNT: pLogin.Visible = false; pChemist.Visible = false; pSrChemist.Visible = false; pRemark.Visible = false; pDisapprove.Visible = false; pAccount.Visible = false; pChangeDueDate.Visible = false; pAccount2.Visible = this.isInvoiceGroupOperation; lbDesc.Text = "Account: ทำรายการแบบกลุ่ม"; break; default: pLogin.Visible = false; pShowChemistFileUpload.Visible = false; pChemist.Visible = false; pSrChemist.Visible = false; pRemark.Visible = false; pDisapprove.Visible = false; pAccount.Visible = false; pChangeDueDate.Visible = false; pAccount2.Visible = false; break; } initialPage(); } }