Exemple #1
0
 public void TestGetDateName()
 {
     Assert.AreEqual("ok", Pro2Col.GetColName4Pro(this.GetType(), "HaveAttribute"));
     Assert.AreEqual(string.Empty, Pro2Col.GetColName4Pro(this.GetType(), "HavenotAttribute"));
     Assert.AreEqual("ok", Pro2Col.GetColName4Pro(new DataNameAttributeTest(), "HaveAttribute"));
     Assert.AreEqual(string.Empty, Pro2Col.GetColName4Pro(new DataNameAttributeTest(), "HavenotAttribute"));
 }
Exemple #2
0
        private void CreateDiskDataTable()
        {
            diskDataSource = new DataTable();
            Disk d = new Disk();

            Pro2Col.AddColumns4Obj(d, diskDataSource, Types.ActionType.ASN);
        }
Exemple #3
0
        private void CreateLokDataTable()
        {
            lokDataSource = new DataTable();
            SKU s = new SKU();
            LOC l = new LOC();

            Pro2Col.AddColumns4Obj(s, lokDataSource, Types.ActionType.Loc);
            Pro2Col.AddColumns4Obj(l, lokDataSource, Types.ActionType.Loc);
        }
Exemple #4
0
        private void CreateDiskDataTable()
        {
            diskDataSource = new DataTable();
            SKU s = new SKU();
            LOC l = new LOC();

            Pro2Col.AddColumns4Obj(s, diskDataSource, Types.ActionType.Part);
            Pro2Col.AddColumns4Obj(l, diskDataSource, Types.ActionType.Part);
        }
Exemple #5
0
 public Disk(SKU sku, DataRow dr)
 {
     this.sku = sku;
     if (!dr.Table.Columns.Contains(this.GetColName4Pro("Id")))
     {
         throw new Exception("料盘号为空,初始化数据失败!");
     }
     Pro2Col.DataRow2Obj(this, dr);
 }
Exemple #6
0
        private void CreateDiskDataTable()
        {
            SKU  s = new SKU();
            Disk d = new Disk();

            this.diskDataSource = new DataTable();
            Pro2Col.AddColumns4Obj(d, diskDataSource, Types.ActionType.Common);
            Pro2Col.AddColumns4Obj(d, diskDataSource, Types.ActionType.Common);
            Common.DataSource.Tables.Add(this.diskDataSource);
        }
Exemple #7
0
        public DataTable UpdateDiskDataTable()
        {
            Disk d = new Disk();

            foreach (DataRow dr in diskDataSource.Rows)
            {
                Pro2Col.Obj2DataRow(disks[dr[d.GetColName4Pro("Id")].ToString()], dr, Types.ActionType.Return);
            }
            return(diskDataSource);
        }
Exemple #8
0
        public DataTable UpdateSKUDataTable()
        {
            SKU s = new SKU();

            foreach (DataRow dr in skuDataSource.Rows)
            {
                s = skus[s.GetKey(dr)];
                Pro2Col.Obj2DataRow(s, dr, Types.ActionType.PutAway);
            }
            return(skuDataSource);
        }
Exemple #9
0
 public SKU(DataRow dr)
 {
     if (!dr.Table.Columns.Contains(GetColName4Pro("Id")))
     {
         throw new Exception("物料P/N为空,初始化数据失败!");
     }
     Pro2Col.DataRow2Obj(this, dr);
     if (this.scanCount == this.count)
     {
         this.scanFinish = true;
     }
 }
Exemple #10
0
 public DataTable UpdateDiskDataTable()
 {
     diskDataSource.Rows.Clear();
     foreach (Disk d in disks.Values)
     {
         if (!d.IsScaned)
         {
             continue;
         }
         DataRow dr = diskDataSource.NewRow();
         Pro2Col.Obj2DataRow(d, dr, Types.ActionType.ASN);
         diskDataSource.Rows.Add(dr);
     }
     return(diskDataSource);
 }
Exemple #11
0
 public DataTable UpdateDiskDataTable()
 {
     diskDataSource.Rows.Clear();
     foreach (Disk d in disks.Values)
     {
         if (d.PartCount == 0)
         {
             continue;
         }
         DataRow dr = diskDataSource.NewRow();
         Pro2Col.Obj2DataRow(d, dr, Types.ActionType.Part);
         Pro2Col.Obj2DataRow(d.Sku, dr, Types.ActionType.Part);
         diskDataSource.Rows.Add(dr);
     }
     return(diskDataSource);
 }
Exemple #12
0
 public DataTable UpdateLocDataTable()
 {
     lokDataSource.Rows.Clear();
     foreach (SKU s in this.skus.Values)
     {
         foreach (LOC l in s.Locs.Values)
         {
             if (l.Count == 0)
             {
                 continue;
             }
             DataRow dr = this.lokDataSource.NewRow();
             Pro2Col.Obj2DataRow(s, dr, Types.ActionType.Loc);
             Pro2Col.Obj2DataRow(l, dr, Types.ActionType.Loc);
             this.lokDataSource.Rows.Add(dr);
         }
     }
     return(lokDataSource);
 }
Exemple #13
0
 public string GetColName4Pro(object o, string propertyName)
 {
     return(Pro2Col.GetColName4Pro(o, propertyName));
 }
Exemple #14
0
 public string GetColName4Pro(string propertyName)
 {
     return(Pro2Col.GetColName4Pro(this.GetType(), propertyName));
 }