Example #1
0
        public int BaseInfo_UpdateProduct(MineProductModel model)
        {
            SqlParameter[] paras =
                {
                    new SqlParameter("@SafeBeginTime",SqlDbType.DateTime),
                    new SqlParameter("@YearProduction",SqlDbType.Float),
                    new SqlParameter("@MonthProduction",SqlDbType.Float),
                    new SqlParameter("@DayProduction",SqlDbType.Float)
                };

            paras[0].Value = model.SafeBeginTime;
            paras[1].Value = model.YearProduction;
            paras[2].Value = model.MonthProduction;
            paras[3].Value = model.DayProduction;

            try
            {
                int iReturn;
                DbHelperSQL.RunProcedure("Mine_BaseInfo_UpdateProduct", paras, out iReturn);
                return iReturn;
            }
            catch
            {
                return -1;
            }
        }
Example #2
0
        public MineProductModel BaseInfo_GetProduct()
        {
            DataSet ds = BaseInfo_GetList("SafeBeginTime,YearProduction,MonthProduction,DayProduction", "1=1");
            try
            {
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    MineProductModel model = new MineProductModel();
                    model.SafeBeginTime = ds.Tables[0].Rows[0]["SafeBeginTime"].ToString().Equals("") ? DateTime.Now : DateTime.Parse(ds.Tables[0].Rows[0]["SafeBeginTime"].ToString());
                    model.YearProduction =ds.Tables[0].Rows[0]["YearProduction"].ToString().Equals("") ? 0:float.Parse(ds.Tables[0].Rows[0]["YearProduction"].ToString());
                    model.MonthProduction =ds.Tables[0].Rows[0]["MonthProduction"].ToString().Equals("") ?0: float.Parse(ds.Tables[0].Rows[0]["MonthProduction"].ToString());
                    model.DayProduction =ds.Tables[0].Rows[0]["DayProduction"].ToString().Equals("") ?0: float.Parse(ds.Tables[0].Rows[0]["DayProduction"].ToString());
                    return model;
                }
                return null;
            }
            catch
            {
                return null;

            }
        }
Example #3
0
 public int BaseInfo_UpdateProduct(MineProductModel model)
 {
     return dal.BaseInfo_UpdateProduct(model);
 }