示例#1
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public bool Update(CustomerService.Model.Solution model)
        {
            int rowsAffected = 0;

            SqlParameter[] parameters =
            {
                new SqlParameter("@GUID",       SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@sDescribe",  SqlDbType.NText),
                new SqlParameter("@solution",   SqlDbType.NText),
                new SqlParameter("@createDate", SqlDbType.DateTime)
            };
            parameters[0].Value = model.GUID;
            parameters[1].Value = model.sDescribe;
            parameters[2].Value = model.solution;
            parameters[3].Value = model.createDate;

            DbHelperSQL.RunProcedure("T_Solution_Update", parameters, out rowsAffected);
            if (rowsAffected > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public CustomerService.Model.Solution GetModel(Guid GUID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@GUID", SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = GUID;

            CustomerService.Model.Solution model = new CustomerService.Model.Solution();
            DataSet ds = DbHelperSQL.RunProcedure("T_Solution_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["GUID"] != null && ds.Tables[0].Rows[0]["GUID"].ToString() != "")
                {
                    model.GUID = new Guid(ds.Tables[0].Rows[0]["GUID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["sDescribe"] != null && ds.Tables[0].Rows[0]["sDescribe"].ToString() != "")
                {
                    model.sDescribe = ds.Tables[0].Rows[0]["sDescribe"].ToString();
                }
                if (ds.Tables[0].Rows[0]["solution"] != null && ds.Tables[0].Rows[0]["solution"].ToString() != "")
                {
                    model.solution = ds.Tables[0].Rows[0]["solution"].ToString();
                }
                if (ds.Tables[0].Rows[0]["createDate"] != null && ds.Tables[0].Rows[0]["createDate"].ToString() != "")
                {
                    model.createDate = DateTime.Parse(ds.Tables[0].Rows[0]["createDate"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#3
0
文件: Solution.cs 项目: NanQi/demo
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public CustomerService.Model.Solution GetModel(Guid GUID)
		{
			SqlParameter[] parameters = {
					new SqlParameter("@GUID", SqlDbType.UniqueIdentifier,16)};
			parameters[0].Value = GUID;

			CustomerService.Model.Solution model=new CustomerService.Model.Solution();
			DataSet ds= DbHelperSQL.RunProcedure("T_Solution_GetModel",parameters,"ds");
			if(ds.Tables[0].Rows.Count>0)
			{
				if(ds.Tables[0].Rows[0]["GUID"]!=null && ds.Tables[0].Rows[0]["GUID"].ToString()!="")
				{
					model.GUID=new Guid(ds.Tables[0].Rows[0]["GUID"].ToString());
				}
				if(ds.Tables[0].Rows[0]["sDescribe"]!=null && ds.Tables[0].Rows[0]["sDescribe"].ToString()!="")
				{
					model.sDescribe=ds.Tables[0].Rows[0]["sDescribe"].ToString();
				}
				if(ds.Tables[0].Rows[0]["solution"]!=null && ds.Tables[0].Rows[0]["solution"].ToString()!="")
				{
					model.solution=ds.Tables[0].Rows[0]["solution"].ToString();
				}
				if(ds.Tables[0].Rows[0]["createDate"]!=null && ds.Tables[0].Rows[0]["createDate"].ToString()!="")
				{
					model.createDate=DateTime.Parse(ds.Tables[0].Rows[0]["createDate"].ToString());
				}
				return model;
			}
			else
			{
				return null;
			}
		}