Esempio n. 1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MesWeb.Model.T_HisMain GetModel(int CurrentDataID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 CurrentDataID,TaskID,SpecificationID,MachineID,MachineTypeID,EmployeeID_Main,EmployeeID_Assistant,Start_Axis_No,Axis_No,Printcode,MaterialRFID from " + TabName);
            strSql.Append(" where CurrentDataID=@CurrentDataID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@CurrentDataID", SqlDbType.Int, 4)
            };
            parameters[0].Value = CurrentDataID;

            MesWeb.Model.T_CurrentData model = new MesWeb.Model.T_CurrentData();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(MesWeb.Model.T_CurrentData model)
 {
     return(dal.Update(model));
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(MesWeb.Model.T_CurrentData model)
 {
     return(dal.Add(model));
 }