/// <summary> /// 验证订单 /// </summary> void valiteordernum() { string ordernum = string.Empty; if (Request["ordernum"] != null && Request["ordernum"] != "") { ordernum = Request["ordernum"]; } if (ordernum != null && ordernum != "") { MSPhotoSubmitDAL photoDal = new MSPhotoSubmitDAL(); if (!photoDal.ExsitOrderNum(ordernum)) { Response.Write("{\"error\":true,\"msg\":\"该订单无效\"}"); } else { if (photoDal.ExistisSubmit(ordernum)) { Response.Write("{\"error\":true,\"msg\":\"该订单已提交过\"}"); } else { Response.Write("{\"success\":true}"); } } } else { Response.Write("{\"error\":true,\"msg\":\"请输入正确的订单\"}"); } Response.End(); }
protected void btnSave_Click(object sender, EventArgs e) { if (Session["strLoginName"].ToString() != null && Session["strLoginName"].ToString() != "") { if (strID != null && strID != "") { MSPhotoSubmitDAL photoDal = new MSPhotoSubmitDAL(); int pass = rno.Checked ? 0 : 1; photoDal.UpdatePhotoSubmitRv(strID, pass); if (printimg.SelectedValue != null && printimg.SelectedValue != "") { PrintPhoto(printimg.SelectedValue); } MessageBox.Show(this, "操作成功!"); } else { MessageBox.Show(this, "操作失败,请重新操作"); } } else { MessageBox.Show(this, "操作失败,请重新操作!"); } }
void showdetailinfo() { printimg.Items.Clear(); printimg.Items.Insert(0, new ListItem("--请选择需打印的照片--", "")); MSPhotoSubmitDAL photoDal = new MSPhotoSubmitDAL(); DataSet photods = photoDal.GetPhotoSubmitDetail(strID); MSPhotoSubmit photomodel = DataConvert.DataRowToModel <MSPhotoSubmit>(photods.Tables[0].Rows[0]); ordernum.Text = photomodel.OrderNum; imgsrc1 = "../../PalmShop/ShopCode/" + photomodel.Img1; imgsrc2 = "../../PalmShop/ShopCode/" + photomodel.Img2; img1.Src = imgsrc1; img2.Src = imgsrc2; userid = photomodel.UID; printimg.Items.Insert(1, new ListItem("照片1", photomodel.Img1)); printimg.Items.Insert(2, new ListItem("照片2", photomodel.Img2)); printimg.DataBind(); if (photomodel.Reivew == 0) { rno.Checked = true; } else { ryes.Checked = true; } }
/// <summary> /// 加载数据 /// </summary> /// <param name="strWhere">条件</param> void LoadData(string strWhere) { MSPhotoSubmitDAL shopdal = new MSPhotoSubmitDAL(); DataSet ds = shopdal.GetPhotoSubmitList(strWhere); DataView dv = ds.Tables[0].DefaultView; AspNetPager1.RecordCount = dv.Count; PagedDataSource pds = new PagedDataSource(); pds.DataSource = dv; pds.AllowPaging = true; pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; pds.PageSize = AspNetPager1.PageSize; Repeater1.DataSource = pds; Repeater1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (null != Common.Common.NoHtml(Request.QueryString["action"])) { strAction = Common.Common.NoHtml(Request.QueryString["action"]); } if (null != Common.Common.NoHtml(Request.QueryString["id"])) { strID = Common.Common.NoHtml(Request.QueryString["id"]); } MSPhotoSubmitDAL dal = new MSPhotoSubmitDAL(); switch (strAction) { case "del": if (dal.UpdatePhotoSubmitState(strID)) { strMessage = "操作成功!"; } else { strMessage = "操作失败!"; } break; case "pass": if (dal.UpdatePhotoSubmitReivew(strID)) { strMessage = "操作成功!"; } else { strMessage = "操作失败!"; } break; } Response.Write(strMessage); Response.End(); }
/// <summary> /// 订单提交 /// </summary> void submitOrder() { string ordernum = string.Empty; int imgcount = 0; string img1 = string.Empty; string img2 = string.Empty; string openid = string.Empty; string userid = string.Empty; if (Session["OpenID"] != null && Session["OpenID"].ToString() != "") { openid = Session["OpenID"].ToString(); } if (openid != null && openid != "") { MSCustomersDAL customerDal = new MSCustomersDAL(); try { userid = customerDal.GetCustomerValueByOpenID("ID", openid).ToString(); } catch (Exception) { } } #region -------------获取请求值------------ try { ordernum = Request.Form.Get("ordernum").ToString(); } catch (Exception) { ordernum = ""; } #endregion try { imgcount = Request.Files.Count; } catch (Exception) { } if (imgcount == 2) { img1 = UploadImg(0, "printimg", ordernum); img2 = UploadImg(1, "shareimg", ordernum); if (userid == null || userid == "" && ordernum != null && ordernum != "") { MSProductOrderDAL orderDal = new MSProductOrderDAL(); userid = orderDal.GetOrderValueByID("CustomerID", ordernum).ToString(); } if (ordernum != null && ordernum != "") { MSPhotoSubmit photoModel = new MSPhotoSubmit(); MSPhotoSubmitDAL photoDal = new MSPhotoSubmitDAL(); photoModel.OrderNum = ordernum; photoModel.Img1 = img1; photoModel.Img2 = img2; photoModel.UID = userid; photoModel.ID = Guid.NewGuid().ToString("N").ToUpper(); if (!photoDal.AddPhotoSubmit(photoModel)) { errormsg = JQDialog.alertOKMsgBoxGoBack(3, "操作失败,请重新操作!", false); } else { errormsg = JQDialog.alertOKMsgBox(3, "操作成功,请等待审核!", "PrintImgOrder.aspx", "succeed"); } } else { errormsg = JQDialog.alertOKMsgBoxGoBack(3, "请输入正确的订单!", false); } } else { errormsg = JQDialog.alertOKMsgBoxGoBack(3, "请选择您要打印的照片和分享的照片!", false); } }