Ejemplo n.º 1
0
        public ProductionLineProbablySaveResponse Execute(ProductionLineProbablySaveRequest request)
        {
            ProductionLineProbablySaveResponse probablySaveResponse   = new ProductionLineProbablySaveResponse();
            ProductionLineProbablyInfo         productionLineProbably = ServiceHelper.LoadService <IProductionService>().GetProductionLineProbably(request.DID);

            productionLineProbably.Name        = request.Name;
            productionLineProbably.TargetYield = request.TargetYield;
            ServiceHelper.LoadService <IProductionService>().SaveProductionLineProbably(productionLineProbably);
            return(probablySaveResponse);
        }
Ejemplo n.º 2
0
        public ProductionLineProbablyGetResponse Execute(ProductionLineProbablyGetRequest request)
        {
            ProductionLineProbablyGetResponse probablyGetResponse    = new ProductionLineProbablyGetResponse();
            ProductionLineProbablyInfo        productionLineProbably = ServiceHelper.LoadService <IProductionService>().GetProductionLineProbably(request.DID);

            if (productionLineProbably != null)
            {
                probablyGetResponse.ProductionLineProbably = productionLineProbably.ToModel();
            }
            return(probablyGetResponse);
        }
Ejemplo n.º 3
0
        public void SaveProductionLineProbably(ProductionLineProbablyInfo productionLineProbablyInfo)
        {
            Database equipDB = dataProvider.EQUIPDataBase;
            string   sql     = string.Format(
                @"update production_line_probably t 
                    set
			        t.name = '{1}',
			        t.production_type = '{2}',
			        t.nowYield = {3},
                    t.targetYield = {4},
                    t.userName = '******'
                    where t.did = {0}"
                , productionLineProbablyInfo.DID, productionLineProbablyInfo.Name, productionLineProbablyInfo.ProductionType
                , int.Parse(productionLineProbablyInfo.NowYield), int.Parse(productionLineProbablyInfo.TargetYield), productionLineProbablyInfo.UserName);

            equipDB.ExecuteScalar(CommandType.Text, sql);
        }
Ejemplo n.º 4
0
        public ProductionLineProbablyInfo GetProductionLineProbably(int did)
        {
            DataTable tb = getProductionLineProbably(did);

            if (tb != null && tb.Rows.Count > 0)
            {
                int i = (tb.Rows.Count - 1);
                ProductionLineProbablyInfo info = new ProductionLineProbablyInfo();
                info.DID            = int.Parse(tb.Rows[i][0].ToString());
                info.Name           = tb.Rows[i][1].ToString();
                info.ProductionType = tb.Rows[0][2].ToString();
                info.NowYield       = tb.Rows[i][3].ToString();
                info.TargetYield    = tb.Rows[i][4].ToString();
                info.UserName       = tb.Rows[i][5].ToString();
                return(info);
            }
            else
            {
                throw new Exception("执行 getProductionLineProbably 查询到空值");
            }
        }
Ejemplo n.º 5
0
 public void SaveProductionLineProbably(ProductionLineProbablyInfo productionLineProbablyInfo)
 {
     this.DataContext.SaveChanges();
 }
Ejemplo n.º 6
0
 public static ProductionLineProbablyModel ToModel(this ProductionLineProbablyInfo entity)
 {
     return(Mapper.Map <ProductionLineProbablyInfo, ProductionLineProbablyModel>(entity));
 }