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; } }
private void initialPage() { m_specification specification = new m_specification(); ddlSpecification.Items.Clear(); ddlSpecification.DataSource = specification.SelectAll(); ddlSpecification.DataBind(); ddlSpecification.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, "0")); bindingData(); }
private void initialPage() { this.listSample = new List <job_sample>(); m_customer customer = new m_customer(); ddlCustomer_id.Items.Clear(); ddlCustomer_id.DataSource = customer.SelectAll(); ddlCustomer_id.DataBind(); ddlCustomer_id.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, "")); ddlContract_person_id.Items.Clear(); ddlContract_person_id.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, "")); m_specification specification = new m_specification(); ddlSecification_id.Items.Clear(); ddlSecification_id.DataSource = specification.SelectAll(); ddlSecification_id.DataBind(); ddlSecification_id.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, "")); ddlJobNumber.Items.Clear(); ddlJobNumber.DataSource = new job_running().SelectAll(); ddlJobNumber.DataBind(); ddlJobNumber.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, "")); m_completion_scheduled m_completion_scheduled = new m_completion_scheduled(); ddlCompletionScheduled.DataSource = m_completion_scheduled.SelectAll(); ddlCompletionScheduled.DataBind(); ddlAddress.Items.Clear(); ddlAddress.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, "")); ddlStatus.Items.Clear(); ddlStatus.DataSource = new m_status().SelectByMainStatus(); ddlStatus.DataBind(); ddlStatus.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, "")); switch (CommandName) { case CommandNameEnum.Add: txtDateOfRequest.Text = DateTime.Now.ToString("dd/MM/yyyy"); txtDate_of_receive.Text = DateTime.Now.ToString("dd/MM/yyyy"); ddlCustomer_id.Enabled = true; ddlContract_person_id.Enabled = true; ddlSecification_id.Enabled = true; txtDateOfRequest.Enabled = true; txtCustomer_ref_no.Enabled = true; txtCompany_name_to_state_in_report.Attributes.Remove("readonly"); //txtCompany_name_to_state_in_report.Attributes["readonly"] = "readonly"; txtJob_number.Enabled = true; txtDate_of_receive.Enabled = true; //txtS_pore_ref_no.Enabled = true; txtSpecRefRevNo.Enabled = true; txtCustomer_ref_no.Enabled = true; rdSample_enoughNo.Enabled = true; rdPersonel_and_workloadYes.Enabled = true; rdPersonel_and_workloadYes.Enabled = true; rdTest_toolYes.Enabled = true; rdTest_methodYes.Enabled = true; //rdCompletion_scheduledNormal_Normal.Enabled = true; //rdCompletion_scheduledNormal_Urgent.Enabled = true; //rdCompletion_scheduledNormal_Express.Enabled = true; rdSample_dipositionYes.Enabled = true; //txtSpecification_other.Enabled = true; //lbOther.Visible = false; btnAddSampleInfo.Enabled = true; btnSave.Enabled = true; btnCancel.Enabled = true; break; case CommandNameEnum.Edit: fillinScreen(); btnAddSampleInfo.Enabled = true; btnSave.Enabled = true; btnCancel.Enabled = true; break; case CommandNameEnum.View: fillinScreen(); ddlCustomer_id.Attributes["readonly"] = "readonly"; ddlContract_person_id.Attributes["readonly"] = "readonly"; ddlSecification_id.Attributes["readonly"] = "readonly"; txtDateOfRequest.Attributes["readonly"] = "readonly"; txtCustomer_ref_no.Attributes["readonly"] = "readonly"; txtCompany_name_to_state_in_report.Attributes["readonly"] = "readonly"; txtJob_number.Attributes["readonly"] = "readonly"; txtDate_of_receive.Attributes["readonly"] = "readonly"; //txtS_pore_ref_no.Attributes["readonly"] = "readonly"; txtSpecRefRevNo.Attributes["readonly"] = "readonly"; txtCustomer_ref_no.Attributes["readonly"] = "readonly"; rdSample_enoughNo.Attributes["readonly"] = "readonly"; rdPersonel_and_workloadYes.Attributes["readonly"] = "readonly"; rdPersonel_and_workloadYes.Attributes["readonly"] = "readonly"; rdTest_toolYes.Attributes["readonly"] = "readonly"; rdTest_methodYes.Attributes["readonly"] = "readonly"; //rdCompletion_scheduledNormal_Normal.Attributes["readonly"] = "readonly"; //rdCompletion_scheduledNormal_Urgent.Attributes["readonly"] = "readonly"; //rdCompletion_scheduledNormal_Express.Attributes["readonly"] = "readonly"; rdSample_dipositionYes.Attributes["readonly"] = "readonly"; //txtSpecification_other.Enabled = false; //lbOther.Visible = false; btnAddSampleInfo.Enabled = false; btnSave.Enabled = false; btnCancel.Enabled = true; break; } //txtSpecification_other.Visible = false; }