Exemple #1
0
        /// <summary>
        /// 标记为已付款
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lbtnMoney_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < repList.Items.Count; i++)
            {
                CheckBox ckChecked = repList.Items[i].FindControl("ckChecked") as CheckBox;

                if (ckChecked.Checked)
                {
                    HiddenField hidfid = repList.Items[i].FindControl("hidfid") as HiddenField;

                    Model.FatherOrder model = bllorder.GetModel(int.Parse(hidfid.Value));
                    model.MoneyState = 1;
                    bllorder.Update(model);
                }
            }

            BindRepList();
        }
        /// <summary>
        /// 确认提交
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            bool isEdit = false;
            int  did    = 0;

            Model.FatherOrder modelFather = new Model.FatherOrder();
            if (int.TryParse(Request.Params["fid"], out fid))
            {
                modelFather = bllFathrt.GetModel(fid);
                did         = modelFather.Id;
                isEdit      = true;
            }
            else
            {
                DataSet ds = bllFathrt.GetList("CustomerId=" + ddlCustomer.SelectedValue + " and AddTime>Convert(datetime,'" + DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00" + "') and Convert(datetime,AddTime) <= Convert(datetime,'" + DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59" + "')");

                if (ds.Tables[0].Rows.Count > 0)
                {
                    modelFather = bllFathrt.GetModel(int.Parse(ds.Tables[0].Rows[0]["Id"].ToString()));
                    isEdit      = true;
                }
                else
                {
                    modelFather.AddTime    = DateTime.Now;
                    modelFather.NumId      = SetFathrtNumID();
                    modelFather.MoneyState = 0;
                }
            }

            if (!string.IsNullOrEmpty(Request.Form["ddlAddress"]))
            {
                modelFather.AddressId = int.Parse(Request.Form["ddlAddress"]);
            }

            modelFather.CustomerId = int.Parse(ddlCustomer.SelectedValue);
            modelFather.StateInfo  = 10022;
            modelFather.WorkersId  = int.Parse(Session["AdminId"].ToString());
            modelFather.Remark     = txtExplain.Text;



            if (!isEdit)
            {
                did = bllFathrt.Add(modelFather);
            }
            else
            {
                bllFathrt.Update(modelFather);
            }


            AddDistribution(did);

            JsMessage("公司订单添加成功", 2000, "true", "index.aspx");
        }