Exemplo n.º 1
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(MobileSoft.Model.HSPR.Tb_HSPR_CommunityCircle model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@CircleID",    SqlDbType.NVarChar,  50),
                new SqlParameter("@CircleName",  SqlDbType.NVarChar, 200),
                new SqlParameter("@CircleMemo",  SqlDbType.NVarChar, 500),
                new SqlParameter("@CircleIndex", SqlDbType.Int,        4),
                new SqlParameter("@BussName",    SqlDbType.NVarChar, 200),
                new SqlParameter("@BussID",      SqlDbType.BigInt,     8),
                new SqlParameter("@CommID",      SqlDbType.BigInt,     8),
                new SqlParameter("@IsDelete",    SqlDbType.Int, 4)
            };
            parameters[0].Value = model.CircleID;
            parameters[1].Value = model.CircleName;
            parameters[2].Value = model.CircleMemo;
            parameters[3].Value = model.CircleIndex;
            parameters[4].Value = model.BussName;
            parameters[5].Value = model.BussID;
            parameters[6].Value = model.CommID;
            parameters[7].Value = model.IsDelete;

            DbHelperSQL.RunProcedure("Proc_Tb_HSPR_CommunityCircle_Update", parameters, out rowsAffected);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MobileSoft.Model.HSPR.Tb_HSPR_CommunityCircle GetModel(string CircleID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@CircleID", SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = CircleID;

            MobileSoft.Model.HSPR.Tb_HSPR_CommunityCircle model = new MobileSoft.Model.HSPR.Tb_HSPR_CommunityCircle();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_HSPR_CommunityCircle_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.CircleID   = ds.Tables[0].Rows[0]["CircleID"].ToString();
                model.CircleName = ds.Tables[0].Rows[0]["CircleName"].ToString();
                model.CircleMemo = ds.Tables[0].Rows[0]["CircleMemo"].ToString();
                if (ds.Tables[0].Rows[0]["CircleIndex"].ToString() != "")
                {
                    model.CircleIndex = int.Parse(ds.Tables[0].Rows[0]["CircleIndex"].ToString());
                }
                model.BussName = ds.Tables[0].Rows[0]["BussName"].ToString();
                if (ds.Tables[0].Rows[0]["BussID"].ToString() != "")
                {
                    model.BussID = long.Parse(ds.Tables[0].Rows[0]["BussID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CommID"].ToString() != "")
                {
                    model.CommID = long.Parse(ds.Tables[0].Rows[0]["CommID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsDelete"].ToString() != "")
                {
                    model.IsDelete = int.Parse(ds.Tables[0].Rows[0]["IsDelete"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }