Esempio n. 1
0
    protected void Save()
    {
        bindCurrentPart();
        if (this.hidCurrentPartID.Value.Length > 0)
        {
            if (this.hidSupplierID.Value.Length > 0)
            {
                ConsignmentPartRecord model = new ConsignmentPartRecord();
                model.Part                = new Part();
                model.Part.PartID         = int.Parse(this.hidCurrentPartID.Value);
                model.Supplier            = new Supplier();
                model.Supplier.SupplierID = int.Parse(this.hidSupplierID.Value);
                model.Description         = this.txtDescription.Text.Trim();
                model.DateModified        = DateTime.Now;

                if (hidRecordID.Value.Length > 0)
                {
                    model.RecordID = int.Parse(this.hidRecordID.Value);
                    Service.UpdateConsignmentPartRecord(model);
                }
                else
                {
                    model = Service.AddConsignmentPartRecord(model);
                    this.hidRecordID.Value = model.RecordID.ToString();
                }
            }
            else
            {
                Response.Write("<script>alert('请选择外协供应商DUNS');</script>");
                return;
            }
        }
    }
Esempio n. 2
0
    //modify or browse Current Record
    private void bindBaseData(string recordGID)
    {
        ConsignmentPartRecord model = Service.GetConsignmentPartRecordbykey(new ConsignmentPartRecord {
            RecordID = int.Parse(recordGID)
        });

        this.hidRecordID.Value   = recordGID;
        this.txtDescription.Text = model.Description;
        if (model.Part != null)
        {
            this.hidCurrentPartID.Value = model.Part.PartID.ToString();
            this.labPartCode.Text       = model.Part.PartCode;
            this.labPartName.Text       = model.Part.PartChineseName;
            if (model.Part.Plant != null)
            {
                this.labPlantName.Text = model.Part.Plant.PlantCode;
            }
            if (model.Part.Supplier != null)
            {
                this.labDUNS.Text = model.Part.Supplier.DUNS;
            }
        }
        if (model.Supplier != null)
        {
            this.hidSupplierID.Value = model.Supplier.SupplierID.ToString();
            hidSupplierDUNS.Value    = model.Supplier.DUNS;
            this.txtSupplier.Text    = model.Supplier.DUNS;
            this.txtFax.Text         = model.Supplier.Fax;
            this.txtTelephone.Text   = model.Supplier.PhoneNumber1;
        }
    }
Esempio n. 3
0
        public void UpdateConsignmentPartRecordTest1()
        {
            ConsignmentPartBLL_Accessor target = new ConsignmentPartBLL_Accessor(); // TODO: Initialize to an appropriate value
            ConsignmentPartRecord       record = null;                              // TODO: Initialize to an appropriate value

            target.UpdateConsignmentPartRecord(record);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Esempio n. 4
0
    private void bindGridView()
    {
        ConsignmentPartRecord filter = new ConsignmentPartRecord();

        if (ddlPlantID.SelectedValue.Length > 0)
        {
            filter.Part                 = new Part();
            filter.Part.Plant           = new Plant();
            filter.Part.Plant.PlantID   = int.Parse(ddlPlantID.SelectedValue);
            filter.Part.Plant.PlantCode = ddlPlantID.SelectedItem.Text;
        }
        if (this.txtPartCode.Text.Trim().Length > 0)
        {
            if (filter.Part == null)
            {
                filter.Part = new Part();
            }
            filter.Part.PartCode = this.txtPartCode.Text.Trim();
        }
        if (this.txtDUNS.Text.Trim().Length > 0)
        {
            if (filter.Part == null)
            {
                filter.Part = new Part();
            }

            filter.Part.Supplier      = new Supplier();
            filter.Part.Supplier.DUNS = this.txtDUNS.Text.Trim();
        }

        if (this.txtDUNS1.Text.Trim().Length > 0)
        {
            if (filter.Supplier == null)
            {
                filter.Supplier = new Supplier();
            }
            filter.Supplier.DUNS = this.txtDUNS1.Text.Trim();
        }
        if (this.txtSupplierName.Text.Trim().Length > 0)
        {
            if (filter.Supplier == null)
            {
                filter.Supplier = new Supplier();
            }
            filter.Supplier.SupplierName = this.txtSupplierName.Text.Trim();
        }

        int pageCount;
        int itemCount;
        List <ConsignmentPartRecord> cprs = Service.QueryConsignmentPartRecordsByPage(filter, this.AspPager1.PageSize, this.AspPager1.SelectPageNumber, out pageCount, out itemCount);

        Filter = filter;
        this.AspPager1.TotalPage   = pageCount;
        this.AspPager1.TotalRecord = itemCount;
        this.GridView1.DataSource  = cprs;
        this.GridView1.DataBind();
    }
Esempio n. 5
0
        public void GetConsignmentPartRecordsTest()
        {
            ConsignmentPartBLL_Accessor  target   = new ConsignmentPartBLL_Accessor(); // TODO: Initialize to an appropriate value
            List <ConsignmentPartRecord> expected = null;                              // TODO: Initialize to an appropriate value
            List <ConsignmentPartRecord> actual;
            ConsignmentPartRecord        filter = new ConsignmentPartRecord();

            actual = target.QueryRecords(filter).ToList();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Esempio n. 6
0
        public void GetConsignmentPartRecordbykeyTest()
        {
            ConsignmentPartBLL_Accessor target = new ConsignmentPartBLL_Accessor(); // TODO: Initialize to an appropriate value
            ConsignmentPartRecord       record = new ConsignmentPartRecord {
                RecordID = new Guid("A19BBA41-41E4-479D-BAAB-01F1482CEA36")
            };
            ConsignmentPartRecord expected = null; // TODO: Initialize to an appropriate value
            ConsignmentPartRecord actual;

            actual = target.GetConsignmentPartRecordbykey(record);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Esempio n. 7
0
        public void UpdateConsignmentPartRecordTest()
        {
            ConsignmentPartBLL    target = new ConsignmentPartBLL(); // TODO: Initialize to an appropriate value
            ConsignmentPartRecord record = new ConsignmentPartRecord {
                RecordID = new Guid("7791DD67-9388-4A14-A64C-B7D48BAB4AB7"), Part = new Part {
                    PartID = new Guid("6D95D410-994C-4DB2-803D-0012CBB90BD9")
                }, Supplier = new Supplier {
                    SupplierID = 2
                }, Description = "test"
            };

            target.UpdateConsignmentPartRecord(record);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Esempio n. 8
0
 protected void butDelete_Click(object sender, EventArgs e)
 {
     if (GridView1.Rows.Count == 1 && GridView1.Rows[0].Visible == false)
     {
         return;
     }
     for (int i = 0; i <= this.GridView1.Rows.Count - 1; i++)
     {
         GridViewRow row       = GridView1.Rows[i];
         bool        isChecked = ((CheckBox)row.FindControl("ChkSelected")).Checked;
         if (isChecked)
         {
             string recordID           = GridView1.DataKeys[row.RowIndex]["RecordID"].ToString();
             ConsignmentPartRecord cpr = new ConsignmentPartRecord();
             cpr.RecordID = int.Parse(recordID);
             Service.DeleteConsignmentPartRecord(cpr);
         }
     }
     bindGridView();
 }
Esempio n. 9
0
 public void DeleteConsignmentPartRecord(ConsignmentPartRecord record)
 {
     Channel.DeleteConsignmentPartRecord(record);
 }
Esempio n. 10
0
 public ConsignmentPartRecord AddConsignmentPartRecord(ConsignmentPartRecord record)
 {
     return(Channel.AddConsignmentPartRecord(record));
 }
Esempio n. 11
0
 public void UpdateConsignmentPartRecord(ConsignmentPartRecord record)
 {
     Channel.UpdateConsignmentPartRecord(record);
 }
Esempio n. 12
0
 public ConsignmentPartRecord GetConsignmentPartRecordbykey(ConsignmentPartRecord record)
 {
     return(Channel.GetConsignmentPartRecordbykey(record));
 }
Esempio n. 13
0
 public List <ConsignmentPartRecord> QueryConsignmentPartRecordsByPage(ConsignmentPartRecord record, int pageSize, int pageNumber, out int pageCount, out int itemCount)
 {
     return(Channel.QueryConsignmentPartRecordsByPage(record, pageSize, pageNumber, out pageCount, out itemCount));
 }
Esempio n. 14
0
 public List <ConsignmentPartRecord> QueryConsignmentPartRecords(ConsignmentPartRecord record)
 {
     return(Channel.QueryConsignmentPartRecords(record));
 }