Beispiel #1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public HM.Model.Qm.Tb_Qm_TaskLevel GetModel(string Id)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@Id", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = Id;

            HM.Model.Qm.Tb_Qm_TaskLevel model = new HM.Model.Qm.Tb_Qm_TaskLevel();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_Qm_TaskLevel_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.Id            = ds.Tables[0].Rows[0]["Id"].ToString();
                model.TaskLevelName = ds.Tables[0].Rows[0]["TaskLevelName"].ToString();
                model.TaskRoleId    = ds.Tables[0].Rows[0]["TaskRoleId"].ToString();
                model.CheckRoleId   = ds.Tables[0].Rows[0]["CheckRoleId"].ToString();
                if (ds.Tables[0].Rows[0]["IsDelete"].ToString() != "")
                {
                    model.IsDelete = int.Parse(ds.Tables[0].Rows[0]["IsDelete"].ToString());
                }
                model.Remark = ds.Tables[0].Rows[0]["Remark"].ToString();
                if (ds.Tables[0].Rows[0]["Sort"].ToString() != "")
                {
                    model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(HM.Model.Qm.Tb_Qm_TaskLevel model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@Id",            SqlDbType.VarChar,  36),
                new SqlParameter("@TaskLevelName", SqlDbType.VarChar,  36),
                new SqlParameter("@TaskRoleId",    SqlDbType.VarChar,  36),
                new SqlParameter("@CheckRoleId",   SqlDbType.VarChar,  36),
                new SqlParameter("@IsDelete",      SqlDbType.Int,       4),
                new SqlParameter("@Remark",        SqlDbType.VarChar),
                new SqlParameter("@Sort",          SqlDbType.Int, 4)
            };
            parameters[0].Value = model.Id;
            parameters[1].Value = model.TaskLevelName;
            parameters[2].Value = model.TaskRoleId;
            parameters[3].Value = model.CheckRoleId;
            parameters[4].Value = model.IsDelete;
            parameters[5].Value = model.Remark;
            parameters[6].Value = model.Sort;

            DbHelperSQL.RunProcedure("Proc_Tb_Qm_TaskLevel_Update", parameters, out rowsAffected);
        }