Ejemplo n.º 1
0
        public EXPPLPIItemColor SetToBussinessObject(EXP_PLPIItemColor Entity)
        {
            EXPPLPIItemColor Model = new EXPPLPIItemColor();

            Model.PLPIItemColorID   = Entity.PLPIItemColorID;
            Model.PLPIID            = Entity.PLPIID;
            Model.MaterialNo        = Entity.MaterialNo;
            Model.Commodity         = Entity.Commodity;
            Model.ArticleID         = Entity.ArticleID;
            Model.ArticleName       = Entity.ArticleID == null ? "" : _context.Sys_Article.Where(m => m.ArticleID == Entity.ArticleID).FirstOrDefault().ArticleName;
            Model.AvgSize           = Entity.AvgSize;
            Model.AvgSizeUnit       = Entity.AvgSizeUnit;
            Model.AvgSizeUnitName   = Entity.AvgSizeUnit == null ? "" : _context.Sys_Unit.Where(m => m.UnitID == Entity.AvgSizeUnit).FirstOrDefault().UnitName;
            Model.SideDescription   = Entity.SideDescription;
            Model.SelectionRange    = Entity.SelectionRange;
            Model.Thickness         = Entity.Thickness;
            Model.ThicknessUnit     = Entity.ThicknessUnit;
            Model.ThicknessUnitName = Entity.ThicknessUnit == null ? "" : _context.Sys_Unit.Where(m => m.UnitID == Entity.ThicknessUnit).FirstOrDefault().UnitName;
            Model.ThicknessAt       = Entity.ThicknessAt;
            Model.ColorID           = Entity.ColorID;
            Model.ColorName         = Entity.ColorID == null ? "" : _context.Sys_Color.Where(m => m.ColorID == Entity.ColorID).FirstOrDefault().ColorName;
            //Model.MeterPLPIItemQty = Entity.MeterPLPIItemQty;
            //Model.FootPLPIItemQty = Entity.FootPLPIItemQty;
            //Model.PLPIItemWeight = Entity.PLPIItemWeight;
            //Model.ItemWeightUnit = Entity.ItemWeightUnit;
            //Model.PackQty = Entity.PackQty;
            //Model.PackUnit = Entity.PackUnit;
            //Model.AvgSizeUnitName = Entity.PackUnit == null ? "" : _context.Sys_Unit.Where(m => m.UnitID == Entity.PackUnit).FirstOrDefault().UnitName;
            Model.Remarks = Entity.Remarks;


            return(Model);
        }
Ejemplo n.º 2
0
        public EXP_PLPIItemColor SetToModelObject(EXPPLPIItemColor model, int userid)
        {
            EXP_PLPIItemColor Entity = new EXP_PLPIItemColor();

            Entity.PLPIItemColorID = model.PLPIItemColorID;
            Entity.PLPIID          = model.PLPIID;
            Entity.Commodity       = model.Commodity;
            Entity.ArticleID       = model.ArticleID;
            Entity.ArticleNo       = model.ArticleNo;
            Entity.ItemTypeID      = model.ItemTypeID;
            Entity.LeatherTypeID   = model.LeatherTypeID;
            Entity.LeatherStatusID = model.LeatherStatusID;
            Entity.MaterialNo      = model.MaterialNo;
            Entity.AvgSize         = model.AvgSize;
            Entity.AvgSizeUnit     = model.AvgSizeUnit;
            //if (string.IsNullOrEmpty(model.AvgSizeUnitName))
            //    Entity.AvgSizeUnit = null;
            //else
            //    Entity.AvgSizeUnit = Convert.ToByte(_context.Sys_Unit.Where(m => m.UnitName == model.AvgSizeUnitName).FirstOrDefault().UnitID);
            Entity.SideDescription = model.SideDescription;
            Entity.SelectionRange  = model.SelectionRange;
            Entity.Thickness       = model.Thickness;
            Entity.ThicknessUnit   = model.ThicknessUnit;
            //if (string.IsNullOrEmpty(model.ThicknessUnitName))
            //    Entity.ThicknessUnit = null;
            //else
            //    Entity.ThicknessUnit = Convert.ToByte(_context.Sys_Unit.Where(m => m.UnitName == model.ThicknessUnitName).FirstOrDefault().UnitID);
            Entity.ThicknessAt      = model.ThicknessAt;
            Entity.ColorID          = model.ColorID;
            Entity.MeterPLPIItemQty = model.MeterPLPIItemQty;
            Entity.FootPLPIItemQty  = model.FootPLPIItemQty;
            Entity.PLPIItemWeight   = model.PLPIItemWeight;
            Entity.ItemWeightUnit   = model.ItemWeightUnit;
            //Entity.PackQty = model.PackQty;
            //if (string.IsNullOrEmpty(model.PackUnitName))
            //    Entity.PackUnit = null;
            //else
            //    Entity.PackUnit = Convert.ToByte(_context.Sys_Unit.Where(m => m.UnitName == model.PackUnitName).FirstOrDefault().UnitID);
            Entity.RecordStatus = "NCF";
            Entity.Remarks      = model.Remarks;
            Entity.SetOn        = DateTime.Now;
            Entity.SetBy        = userid;
            Entity.IPAddress    = GetIPAddress.LocalIPAddress();

            return(Entity);
        }