protected void Save_Btn_Click(object sender, EventArgs e) { M_Ex_PreOrder poMod = new M_Ex_PreOrder(); if (Mid > 0) { poMod = poBll.SelReturnModel(Mid); } poMod.ClientMobile = ClientMobile_T.Text; poMod.ClientName = ClientName_T.Text; poMod.ClientDate = Convert.ToDateTime(ClientDate.Text + " " + ClientDate2.Text + ":00"); poMod.ClientNeed = ClientNeed_Hid.Value; poMod.Remark = Remark.Text; if (poMod.ID > 0) { poBll.UpdateByID(poMod); } else { M_UserInfo mu = buser.GetLogin(); poMod.EmployID = mu.UserID; poMod.EmployName = mu.UserName; poMod.StoreID = mu.SiteID; poBll.Insert(poMod); } function.WriteSuccessMsg("操作成功", "PreOrder.aspx"); }
protected void Page_Load(object sender, EventArgs e) { ExHelper.CheckUserAuth("cash"); if (!IsPostBack) { if (Mid > 0) { M_Ex_PreOrder poMod = poBll.SelReturnModel(Mid); ClientMobile_T.Text = poMod.ClientMobile; ClientName_T.Text = poMod.ClientName; ClientDate.Text = poMod.ClientDate.ToString("yyyy/MM/dd"); ClientDate2.Text = poMod.ClientDate.ToString("HH:mm"); ClientNeed_Hid.Value = poMod.ClientNeed; Remark.Text = poMod.Remark; } else { ClientDate.Text = DateTime.Now.ToString("yyyy/MM/dd"); } } }
protected void EGV_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "del2": poBll.Del(e.CommandArgument.ToString()); break; case "fast": //生成订单后,跳转至指定界面 M_UserInfo mu = buser.GetLogin(); M_UserInfo client = new M_UserInfo(); M_Ex_PreOrder poMod = poBll.SelReturnModel(Convert.ToInt32(e.CommandArgument)); if (poMod == null) { function.WriteErrMsg("预约单不存在"); } if (poMod.StoreID != mu.SiteID) { function.WriteErrMsg("不可操作该订单"); } if (poMod.ZStatus != 0) { function.WriteErrMsg("预约单状态不正确"); } DataTable infoDT = JsonConvert.DeserializeObject <DataTable>(poMod.ClientNeed); //---------------------------------- List <M_CartPro> cpList = new List <M_CartPro>(); M_OrderList orderMod = orderBll.NewOrder(mu, M_OrderList.OrderEnum.Normal); orderMod.Userid = mu.UserID; orderMod.AddUser = mu.UserName;//收银员名称 orderMod.Receiver = client.UserID.ToString(); orderMod.Rename = client.UserName; orderMod.StoreID = mu.SiteID; orderMod.Ordersamount = 0; foreach (DataRow dr in infoDT.Rows) { M_CartPro cpMod = new M_CartPro(); M_Product proMod = proBll.GetproductByid(Convert.ToInt32(dr["ProID"])); cpMod.ProID = proMod.ID; cpMod.Proname = proMod.Proname; cpMod.Danwei = proMod.ProUnit; cpMod.Shijia = proMod.LinPrice; cpMod.Pronum = 1; cpMod.AllMoney = cpMod.Shijia * cpMod.Pronum; orderMod.Ordersamount += cpMod.AllMoney; //------------------------- cpMod.Username = client.UserName; cpMod.StoreID = mu.SiteID; cpMod.Addtime = DateTime.Now; cpMod.code = DataConvert.CLng(dr["empid"]).ToString(); //技师ID cpMod.ProInfo = DataConvert.CStr(dr["empname"]); //技师姓名 cpList.Add(cpMod); } orderMod.id = orderBll.insert(orderMod); foreach (M_CartPro cpMod in cpList) { cpMod.Orderlistid = orderMod.id; cpMod.ID = cpBll.GetInsert(cpMod); } poMod.ZStatus = 99; poBll.UpdateByID(poMod); Response.Redirect("/Extend/Order/FastOrder.aspx?ID=" + orderMod.id); break; } MyBind(); }