Ejemplo n.º 1
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(HM.Model.Eq.Tb_EQ_TaskEquipment model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@TaskEqId",      SqlDbType.VarChar,   36),
                new SqlParameter("@TaskId",        SqlDbType.VarChar,   36),
                new SqlParameter("@EquiId",        SqlDbType.VarChar,   36),
                new SqlParameter("@PollingNote",   SqlDbType.NVarChar, 500),
                new SqlParameter("@PollingResult", SqlDbType.NVarChar,   4),
                new SqlParameter("@IsMend",        SqlDbType.NVarChar,   4),
                new SqlParameter("@BSBH",          SqlDbType.NVarChar,  50),
                new SqlParameter("@IsHandle",      SqlDbType.NVarChar,   4),
                new SqlParameter("@HandlePId",     SqlDbType.VarChar,   36),
                new SqlParameter("@IsDelete",      SqlDbType.Int,        4),
                new SqlParameter("@AddDate",       SqlDbType.DateTime)
            };
            parameters[0].Value  = model.TaskEqId;
            parameters[1].Value  = model.TaskId;
            parameters[2].Value  = model.EquiId;
            parameters[3].Value  = model.PollingNote;
            parameters[4].Value  = model.PollingResult;
            parameters[5].Value  = model.IsMend;
            parameters[6].Value  = model.BSBH;
            parameters[7].Value  = model.IsHandle;
            parameters[8].Value  = model.HandlePId;
            parameters[9].Value  = model.IsDelete;
            parameters[10].Value = model.AddDate;

            DbHelperSQL.RunProcedure("Proc_Tb_EQ_TaskEquipment_Update", parameters, out rowsAffected);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public HM.Model.Eq.Tb_EQ_TaskEquipment GetModel(string TaskEqId)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@TaskEqId", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = TaskEqId;

            HM.Model.Eq.Tb_EQ_TaskEquipment model = new HM.Model.Eq.Tb_EQ_TaskEquipment();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_EQ_TaskEquipment_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.TaskEqId      = ds.Tables[0].Rows[0]["TaskEqId"].ToString();
                model.TaskId        = ds.Tables[0].Rows[0]["TaskId"].ToString();
                model.EquiId        = ds.Tables[0].Rows[0]["EquiId"].ToString();
                model.PollingNote   = ds.Tables[0].Rows[0]["PollingNote"].ToString();
                model.PollingResult = ds.Tables[0].Rows[0]["PollingResult"].ToString();
                model.IsMend        = ds.Tables[0].Rows[0]["IsMend"].ToString();
                model.BSBH          = ds.Tables[0].Rows[0]["BSBH"].ToString();
                model.IsHandle      = ds.Tables[0].Rows[0]["IsHandle"].ToString();
                model.HandlePId     = ds.Tables[0].Rows[0]["HandlePId"].ToString();
                if (ds.Tables[0].Rows[0]["IsDelete"].ToString() != "")
                {
                    model.IsDelete = int.Parse(ds.Tables[0].Rows[0]["IsDelete"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AddDate"].ToString() != "")
                {
                    model.AddDate = DateTime.Parse(ds.Tables[0].Rows[0]["AddDate"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }