public void initialInfo(job_info _job, job_sample _sample)
        {
            /*INFO*/
            if (_job != null && _sample != null)
            {
                m_customer cus = new m_customer();
                cus                       = cus.SelectByID(_job.customer_id);
                lbPoNo.Text               = (_sample.sample_po == null) ? String.Empty : _sample.sample_po.ToString();
                lbDate.Text               = DateTime.Now.ToString("MM/dd/yyyy");
                lbCompany.Text            = String.Format("{0}<br />{1}", cus.company_name, cus.address);
                lbDateSampleReceived.Text = Convert.ToDateTime(_job.date_of_receive).ToString("MM/dd/yyyy");
                String[] tmp = _sample.job_number.Split('-');



                lbRefNo.Text = String.Format("{4}ATT/{0}/{1}/{2}-{3}", tmp[0], _job.date_of_receive.Value.ToString("yy"), tmp[1], tmp[2], (_sample.amend_count > 0 ? (_sample.amend_count == 1 ? "AM/" : "AM/" + _sample.amend_count) : ""));

                ////String.Format("AM/ATT/ELP/17/XXXX-XX")
                //lbDownloadName.Text = _sample.job_number.ToString();
                lbDateTestCompleted.Text = Convert.ToDateTime(_sample.due_date).ToString("MM/dd/yyyy");

                lbSampleDescription.Text = String.Format("Description:{0}<br />Model:{1}<br />Surface Area:{2}<br />Remark:{3}<br />", _sample.description, _sample.model, _sample.surface_area, _sample.remarks);

                m_specification mSpec = new m_specification();
                mSpec = mSpec.SelectByID(_sample.specification_id);
                m_type_of_test typeOfTest = new m_type_of_test();
                typeOfTest   = typeOfTest.SelectByID(_sample.type_of_test_id);
                txtSpec.Text = String.Format("Specification [{0}]-->Type Of Test [{1}]", (mSpec == null) ? String.Empty : mSpec.name, typeOfTest.name);
            }
        }
Exemple #2
0
        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 gvJob_SelectedIndexChanged(object sender, EventArgs e)
        {
            int key = Convert.ToInt32(gvJob.SelectedDataKey.Value);

            job_sample jobSample = new job_sample().SelectByID(key);
            job_info   jobInfo   = new job_info().SelectByID(this.JobID);

            if (jobInfo != null)
            {
                m_customer cus = new m_customer().SelectByID(jobInfo.customer_id);
                m_customer_contract_person cus_con_per = new m_customer_contract_person().SelectByID(jobInfo.contract_person_id);
                lbJobNo.Text    = jobSample.job_number; // String.Format("{0}{1}", jobSample.job_running.prefix, Convert.ToInt32(jobInfo.job_number).ToString("00000"));
                lbClient.Text   = cus.company_name;     // jobInfo.m_customer.company_name;
                lbContract.Text = cus_con_per.name;     // jobInfo.m_customer_contract_person.name;


                List <job_sample> samples = job_sample.FindAllBySampleID(key);//.FindAllByJobID(jobInfo.ID);
                if (samples != null && samples.Count > 0)
                {
                    lbSample.Text = samples[0].description.Length > 30 ? samples[0].description.Substring(0, 30) + "  ..." : samples[0].description;
                    int spec_id = 0;
                    foreach (job_sample s in samples)
                    {
                        m_specification spec = new m_specification().SelectByID(s.specification_id);

                        lbSpec.Text = spec.name.Length > 15 ? spec.name.Substring(0, 15) + "...":spec.name;

                        if (spec_id != s.specification_id)
                        {
                            spec_id = s.specification_id;
                        }
                        m_type_of_test tot = new m_type_of_test().SelectByID(s.type_of_test_id);
                        type_of_test = tot.name + ","; //String.Format("<i class=\"icon-check\"></i> {0} ", tot.name);
                    }
                    lbTot.Text = type_of_test.Substring(0, type_of_test.Length - 1);
                    if (jobInfo.sample_diposition != null)
                    {
                        if (jobInfo.sample_diposition.Equals("Y"))
                        {
                            sample_diposition = "Discard";// "<i class=\"icon-check\"></i>Discard<i class=\"icon-check-empty\"></i>Return";
                        }
                        else
                        {
                            sample_diposition = "Return";// "<i class=\"icon-check-empty\"></i>Discard <i class=\"icon-check\"></i>Return";
                        }
                        lbSd.Text = sample_diposition;
                    }
                    lbSa.Text = samples[0].surface_area;
                }
            }
            else
            {
                //btnCancel_Click(null, null);
            }

            Console.WriteLine();
        }
        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();
        }
        protected void gvResult_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            this.PKID = int.Parse(e.Keys[0].ToString().Split(Constants.CHAR_COMMA)[0]);

            m_specification cus = new m_specification().SelectByID(this.PKID);

            if (cus != null)
            {
                cus.Delete();
                //Commit
                GeneralManager.Commit();

                bindingData();
            }
        }
 private void bindingData()
 {
     searchResult        = new m_specification().SearchData();
     gvResult.DataSource = searchResult;
     gvResult.DataBind();
     gvResult.UseAccessibleHeader    = true;
     gvResult.HeaderRow.TableSection = TableRowSection.TableHeader;
     if (gvResult.Rows.Count > 0)
     {
         lbTotalRecords.Text = String.Format(Constants.TOTAL_RECORDS, gvResult.Rows.Count);
     }
     else
     {
         lbTotalRecords.Text = string.Empty;
     }
 }
Exemple #7
0
        private void fillinScreen()
        {
            m_specification cus = new m_specification().SelectByID(this.PKID);

            txtName.Text = cus.name;
        }
        private void fillinScreen()
        {
            type_of_test = "";
            job_sample jobSample = new job_sample().SelectByID(this.SampleID);
            job_info   jobInfo   = new job_info().SelectByID(this.JobID);

            if (jobInfo != null)
            {
                m_customer cus = new m_customer().SelectByID(jobInfo.customer_id);
                m_customer_contract_person cus_con_per = new m_customer_contract_person().SelectByID(jobInfo.contract_person_id);
                lbClient.Text   = cus.company_name; // jobInfo.m_customer.company_name;
                lbContract.Text = cus_con_per.name; // jobInfo.m_customer_contract_person.name;


                List <job_sample> samples = job_sample.FindAllByJobID(jobInfo.ID);
                if (samples != null && samples.Count > 0)
                {
                    lbSample.Text = samples[0].description.Length > 30 ? samples[0].description.Substring(0, 30) + "  ..." : samples[0].description;
                    int spec_id = 0;
                    int index   = 0;
                    foreach (job_sample s in samples)
                    {
                        if (index == 0)
                        {
                            lbJobNo.Text = s.job_number.Split('-')[0] + "-" + s.job_number.Split('-')[1] + "-" + s.job_number.Split('-')[2] + ",";// String.Format("{0}{1}", jobSample.job_running.prefix, Convert.ToInt32(jobInfo.job_number).ToString("00000"));
                        }
                        else
                        {
                            lbJobNo.Text += s.job_number.Split('-')[2] + ",";
                        }
                        m_specification spec = new m_specification().SelectByID(s.specification_id);

                        lbSpec.Text = spec.name.Length > 15 ? spec.name.Substring(0, 15) + "..." : spec.name;
                        if (spec_id != s.specification_id)
                        {
                            spec_id = s.specification_id;
                        }
                        m_type_of_test tot = new m_type_of_test().SelectByID(s.type_of_test_id);
                        type_of_test += tot.name + ","; //String.Format("<i class=\"icon-check\"></i> {0} ", tot.name);
                        index++;
                    }

                    lbTot.Text = type_of_test.Substring(0, type_of_test.Length - 1);
                    if (jobInfo.sample_diposition != null)
                    {
                        if (jobInfo.sample_diposition.Equals("Y"))
                        {
                            sample_diposition = "Discard";// "<i class=\"icon-check\"></i>Discard<i class=\"icon-check-empty\"></i>Return";
                        }
                        else
                        {
                            sample_diposition = "Return";// "<i class=\"icon-check-empty\"></i>Discard <i class=\"icon-check\"></i>Return";
                        }
                        lbSd.Text = sample_diposition;
                    }
                    lbSa.Text = samples[0].surface_area;
                }

                lbJobNo.Text = lbJobNo.Text.Substring(0, lbJobNo.Text.Length - 1);
                ///
                ReportParameterCollection reportParameters = new ReportParameterCollection();

                reportParameters.Add(new ReportParameter("pJobNo", lbJobNo.Text));
                reportParameters.Add(new ReportParameter("pClient", lbClient.Text));
                reportParameters.Add(new ReportParameter("pContract", lbContract.Text));
                reportParameters.Add(new ReportParameter("pSample", lbSample.Text));
                reportParameters.Add(new ReportParameter("pSpec", lbSpec.Text));
                reportParameters.Add(new ReportParameter("pTest", lbTot.Text));
                reportParameters.Add(new ReportParameter("pSampleD", lbSd.Text));



                // Variables
                Warning[] warnings;
                string[]  streamIds;
                string    mimeType  = string.Empty;
                string    encoding  = string.Empty;
                string    extension = string.Empty;


                // Setup the report viewer object and get the array of bytes
                ReportViewer viewer = new ReportViewer();
                viewer.ProcessingMode         = ProcessingMode.Local;
                viewer.LocalReport.ReportPath = Server.MapPath("~/ReportObject/rptStricker.rdlc");
                viewer.LocalReport.SetParameters(reportParameters);
            }
            else
            {
                //btnCancel_Click(null, null);
            }
        }
        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;
        }