示例#1
0
        protected void Button_Submit_Click(object sender, EventArgs e)
        {
            if (CurrentUser != null)
            {
                GroupApplyModel model = new GroupApplyModel();

                model.GroupApplyID   = CommDataHelper.GetNewSerialNum(AppType.GroupShopping);
                model.ApplyBrief     = TextBox_Message.Text;
                model.ApplyStatus    = (int)GroupProductApplyStatus.申请中;
                model.ApplyTime      = DateTime.Now;
                model.ConfirmTime    = DateTime.Now;
                model.GroupProductID = Convert.ToInt32(Request.QueryString["productid"]);
                model.UserID         = CurrentUser.UserId;

                abll.Add(model);


                if (Session["group-product-apply"] != null)
                {
                    Session.Remove("group-product-apply");
                }

                MessageBox.ShowAndRedirect(this, "申请成功,请等待管理员审批", Request.RawUrl);
            }
            else
            {
                Session["group-product-apply"] = TextBox_Message.Text;
                Response.Redirect("/Login.aspx?returnurl=" + Request.RawUrl);
            }
        }
示例#2
0
        public void Update(GroupApplyModel model)
        {
            DbCommand Command = dbw.GetStoredProcCommand("UP_gsApply_Update");

            dbw.AddInParameter(Command, "@GroupApplyID", DbType.Int32, model.GroupApplyID);
            dbw.AddInParameter(Command, "@GroupProductID", DbType.Int32, model.GroupProductID);
            dbw.AddInParameter(Command, "@UserID", DbType.String, model.UserID);
            dbw.AddInParameter(Command, "@ApplyStatus", DbType.Int16, model.ApplyStatus);
            dbw.AddInParameter(Command, "@ApplyBrief", DbType.String, model.ApplyBrief);
            dbw.AddInParameter(Command, "@ApplyTime", DbType.DateTime, model.ApplyTime);
            dbw.AddInParameter(Command, "@ConfirmTime", DbType.DateTime, model.ConfirmTime);

            dbw.ExecuteNonQuery(Command);
        }
示例#3
0
        private GroupApplyModel GetModel(DataRow row)
        {
            GroupApplyModel model = new GroupApplyModel();

            model.ApplyBrief     = Convert.ToString(row["ApplyBrief"]);
            model.ApplyStatus    = Convert.ToInt16(row["ApplyStatus"]);
            model.ApplyTime      = Convert.ToDateTime(row["ApplyTime"]);
            model.ConfirmTime    = Convert.ToDateTime(row["ConfirmTime"]);
            model.GroupApplyID   = Convert.ToInt32(row["GroupApplyID"]);
            model.GroupProductID = Convert.ToInt32(row["GroupProductID"]);
            model.UserID         = Convert.ToString(row["UserID"]);

            return(model);
        }
示例#4
0
        public GroupApplyModel GetModel(int GroupApplyID)
        {
            DbCommand Command = dbr.GetStoredProcCommand("UP_gsApply_GetModel");

            dbr.AddInParameter(Command, "@GroupApplyID", DbType.Int32, GroupApplyID);
            DataTable dt = dbr.ExecuteDataSet(Command).Tables[0];

            GroupApplyModel model = null;

            if (dt.Rows.Count > 0)
            {
                model = GetModel(dt.Rows[0]);
            }
            return(model);
        }
 public void Update(GroupApplyModel model)
 {
     dal.Update(model);
 }
 public void Add(GroupApplyModel model)
 {
     dal.Add(model);
 }