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); } }
public void Add(GroupApplyModel model) { DbCommand Command = dbw.GetStoredProcCommand("UP_gsApply_ADD"); 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); }
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; }
public void Update(GroupApplyModel model) { dal.Update(model); }
public void Add(GroupApplyModel model) { dal.Add(model); }