Example #1
0
        public M_Group GetModelFromReader(DbDataReader rdr)
        {
            M_Group model = new M_Group();

            model.GroupID      = Convert.ToInt32(rdr["GroupID"]);
            model.GroupName    = ConverToStr(rdr["GroupName"]);
            model.OtherName    = ConverToStr(rdr["OtherName"]);
            model.Description  = ConverToStr(rdr["Description"]);
            model.RegSelect    = ConverToBool(rdr["RegSelect"]);
            model.IsDefault    = ConverToBool(rdr["IsDefault"]);
            model.CCountPerDay = ConvertToInt(rdr["CCountPerDay"]);
            model.FavCount     = ConvertToInt(rdr["FavCount"]);
            model.ConsumeType  = ConvertToInt(rdr["ConsumeType"]);
            model.UpGradeMoney = ConverToDouble(rdr["UpGradeMoney"]);
            model.UpSIcon      = ConverToDouble(rdr["UpSIcon"]);
            model.UpPoint      = ConverToDouble(rdr["UpPoint"]);
            model.CompanyGroup = ConvertToInt(rdr["CompanyGroup"]);
            model.VIPNum       = ConvertToInt(rdr["VIPNum"]);
            model.VIPGroup     = ConvertToInt(rdr["VIPGroup"]);
            model.RebateRate   = ConvertToInt(rdr["RebateRate"]);
            //model.Credit = ConvertToInt(rdr["Credit"]);
            model.Enroll        = ConverToStr(rdr["Enroll"]);
            model.ParentGroupID = ConvertToInt(rdr["ParentGroupID"]);
            model.SignImg       = ConverToStr(rdr["SignImg"]);
            model.OrderID       = ConvertToInt(rdr["OrderID"]);
            rdr.Close();
            return(model);
        }
Example #2
0
        public override SqlParameter[] GetParameters()
        {
            M_Group model = this;

            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.GroupID;
            sp[1].Value  = model.GroupName;
            sp[2].Value  = model.OtherName;
            sp[3].Value  = model.Description;
            sp[4].Value  = model.RegSelect;
            sp[5].Value  = model.IsDefault;
            sp[6].Value  = model.CCountPerDay;
            sp[7].Value  = model.FavCount;
            sp[8].Value  = model.ConsumeType;
            sp[9].Value  = model.UpGradeMoney;
            sp[10].Value = model.UpSIcon;
            sp[11].Value = model.UpPoint;
            sp[12].Value = model.CompanyGroup;
            sp[13].Value = model.VIPNum;
            sp[14].Value = model.VIPGroup;
            sp[15].Value = model.RebateRate;
            sp[16].Value = model.Credit;
            sp[17].Value = model.Enroll;
            sp[18].Value = model.ParentGroupID;
            sp[19].Value = model.SignImg;
            sp[20].Value = model.OrderID;
            return(sp);
        }
Example #3
0
 protected void EBtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         M_Group info = new M_Group();
         info.GroupID = DataConverter.CLng(this.HdnGroupID.Value);
         info.GroupName = this.TxtGroupName.Text.Trim();
         info.Description = this.TxtDescription.Text.Trim();
         info.RegSelect = DataConverter.CBool(this.RBLReg.SelectedValue);
         if (info.GroupID == 0)
             this.bll.Add(info);
         else
             this.bll.Update(info);
         Response.Redirect("GroupManage.aspx");
     }
 }
Example #4
0
 bool ID_Group.Add(M_Group info)
 {
     string strSql = "PR_Group_Add";
     SqlParameter[] cmdParams = GetParameters(info);
     return SqlHelper.ExecuteProc(strSql, cmdParams);
 }
Example #5
0
 /// <summary>
 /// 将模型信息的各属性值传递到参数中
 /// </summary>
 /// <param name="Info"></param>
 /// <returns></returns>
 private static SqlParameter[] GetParameters(M_Group Info)
 {
     SqlParameter[] parameter = new SqlParameter[] {
         new SqlParameter("@GroupID", SqlDbType.Int, 4),
         new SqlParameter("@GroupName", SqlDbType.NVarChar, 50),
         new SqlParameter("@Description", SqlDbType.NVarChar, 255),
         new SqlParameter("@RegSelect", SqlDbType.Bit, 1)
     };
     parameter[0].Value = Info.GroupID;
     parameter[1].Value = Info.GroupName;
     parameter[2].Value = Info.Description;
     parameter[3].Value = Info.RegSelect;
     return parameter;
 }
Example #6
0
 /// <summary>
 /// 从DataReader中读取模型记录
 /// </summary>
 /// <param name="rdr">DataReader</param>
 /// <returns>M_ModelInfo 模型信息</returns>
 private static M_Group GetInfoFromReader(SqlDataReader rdr)
 {
     M_Group info = new M_Group();
     info.GroupID = DataConverter.CLng(rdr["GroupID"].ToString());
     info.GroupName = rdr["GroupName"].ToString();
     info.Description = rdr["Description"].ToString();
     info.RegSelect = DataConverter.CBool(rdr["RegSelect"].ToString());
     return info;
 }
Example #7
0
 public bool Update(M_Group info)
 {
     return dal.Update(info);
 }
Example #8
0
 public bool Add(M_Group info)
 {
     return dal.Add(info);
 }