protected void Submit_B_Click(object sender, EventArgs e) { string str = Request.Form["PromoProlist"]; if (!string.IsNullOrEmpty(str)) { str = OrderNode(bn.SelByIDS(str), "", ""); if (str.LastIndexOf(",") > 0) { str = str.TrimEnd(','); } M_Scheme ms = bs.GetSelect(PID); ms.SStartTime = DataConverter.CDate(txtStartTime.Text); ms.SEndTime = DataConverter.CDate(txtEndTime.Text); ms.SType = DataConverter.CLng(RadioButtonList1.SelectedValue.ToString()); ms.SName = txtName.Text; ms.SList = str; if (Request.QueryString["ID"] != null) { bs.GetUpdate(ms); } else { ms.SAddTime = DateTime.Now; bs.GetInsert(ms); } Response.Write("<script>location.href='AgioProject.aspx'</script>"); } else { Response.Write("<script>window.alert('请选择打折商品!');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { ZoomLa.Common.function.AccessRulo(); B_Admin ba = new B_Admin(); if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["ID"])) { PID = int.Parse(Request.QueryString["ID"]); M_Scheme ms = bs.GetSelect(PID); txtName.Text = ms.SName; RadioButtonList1.SelectedValue = ms.SType.ToString(); if (ms.SStartTime.ToString() == ms.SEndTime.ToString()) { txtEndTime.Text = ""; txtStartTime.Text = ""; } else { txtStartTime.Text = ms.SStartTime.Date.ToString(); txtEndTime.Text = ms.SEndTime.Date.ToString(); } PromoBind(ms.SList); type = "修改"; } Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='ProductManage.aspx'>商城管理</a></li><li><a href='PresentProject.aspx'>促销方案管理</a></li><li>" + type + "打折方案</li>"); } }
/// <summary> ///不存在则添加否则更新 /// </summary> /// <param name="Scheme"></param> /// <returns></returns> public bool InsertUpdate(M_Scheme model) { if (model.ID > 0) { GetUpdate(model); } else { GetInsert(model); } return(true); }
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["ID"])) { M_Scheme schMod = bs.GetSelect(Convert.ToInt32(Request.QueryString["ID"])); if (RadioButtonList1.SelectedValue == schMod.SType.ToString()) { PromoBind(schMod.SList); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "clearall", "clearAll();", true); } } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "clearall", "clearAll();", true); } }
/// <summary> ///添加记录 /// </summary> /// <param name="Scheme"></param> /// <returns></returns> public bool GetInsert(M_Scheme model) { return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)) > 0); }
/// <summary> /// 根据ID更新 /// </summary> public bool UpdateByID(M_Scheme model) { return(Sql.UpdateByIDs(TbName, PK, model.ID.ToString(), BLLCommon.GetFieldAndPara(model), model.GetParameters())); }