예제 #1
0
 private void ShowInfo(int id)
 {
     Jium.BLL.consumer   bll   = new Jium.BLL.consumer();
     Jium.Model.consumer model = bll.GetModel(id);
     //this.lblid.Text=model.id.ToString();
     this.lblcname.Text   = model.cname;
     this.lblccode.Text   = model.ccode;
     this.lblcphone.Text  = model.cphone;
     this.lblcemail.Text  = model.cemail;
     this.lblclevel.Text  = model.clevel;
     this.lblcsum.Text    = model.csum.ToString();
     this.lblcsex.Text    = model.csex.ToString();
     this.lblcremark.Text = model.cremark;
     this.lblcss1.Text    = model.css1;
     //this.lblcss2.Text=model.css2;
     //this.lblcss3.Text=model.css3;
     //this.lblcss4.Text=model.css4;
     //this.lblcss5.Text=model.css5;
     //this.lblcsd1.Text=model.csd1.ToString();
     //this.lblcsd2.Text=model.csd2.ToString();
     //this.lblcsd3.Text=model.csd3.ToString();
     //this.lblcsd4.Text=model.csd4.ToString();
     //this.lblcsd5.Text=model.csd5.ToString();
     //this.lblcsdc1.Text=model.csdc1.ToString();
     //this.lblcsdc2.Text=model.csdc2.ToString();
     //this.lblcsdc3.Text=model.csdc3.ToString();
     //this.lblcsdc4.Text=model.csdc4.ToString();
     //this.lblcsdc5.Text=model.csdc5.ToString();
 }
예제 #2
0
        protected void btnSearchConsumer_Click(object sender, EventArgs e)
        {
            Jium.BLL.consumer bll      = new Jium.BLL.consumer();
            StringBuilder     strWhere = new StringBuilder();

            if (txtCphone.Text.Trim() != "")
            {
#warning 代码生成警告:请修改 keywordField 为需要匹配查询的真实字段名称
                strWhere.AppendFormat("cphone = '{0}'", txtCphone.Text.Trim());
            }
            else
            {
                /// new user?
                return;
            }
            strWhere.Append(" and csd5=5 order by clevel desc");
            var consumers = bll.GetModelList(strWhere.ToString());
            if (consumers.Count == 0)
            {
                Maticsoft.Common.MessageBox.Show(this, "账户信息不存在,请重新输入");
                return;
            }
            txtCcode.Text    = consumers[0].ccode;
            txtCname.Text    = consumers[0].cname;
            txtSumMoney.Text = consumers[0].csum.ToString();
            LinkButtonBuyHistory.PostBackUrl     = string.Format("~/piorecord/list.aspx?id={0}", consumers[0].ccode);
            LinkButtonBuyHistory.Enabled         = true;
            LinkButtonServiceHistory.PostBackUrl = string.Format("~/consumerservice/list.aspx?id={0}", consumers[0].ccode);
            LinkButtonServiceHistory.Enabled     = true;
        }
예제 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Jium.BLL.consumer bll = new Jium.BLL.consumer();
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             int id = (Convert.ToInt32(Request.Params["id"]));
             bll.Delete(id);
             Response.Redirect("list.aspx");
         }
     }
 }
예제 #4
0
        protected void btnSearchConsumer_Click(object sender, EventArgs e)
        {
            Jium.BLL.consumer bll      = new Jium.BLL.consumer();
            StringBuilder     strWhere = new StringBuilder();

            if (txtCphone.Text.Trim() != "")
            {
#warning 代码生成警告:请修改 keywordField 为需要匹配查询的真实字段名称
                strWhere.AppendFormat("cphone = '{0}'", txtCphone.Text.Trim());
            }
            else
            {
                /// new user?
                return;
            }
            var consumers = bll.GetModelList(strWhere.ToString());
            if (consumers.Count != 1)
            {
                return;
            }
            txtCcode.Text = consumers[0].ccode;
            txtCname.Text = consumers[0].cname;
        }
예제 #5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtcname.Text.Trim().Length == 0)
            {
                strErr += "cname不能为空!\\n";
            }
            if (this.txtccode.Text.Trim().Length == 0)
            {
                strErr += "ccode不能为空!\\n";
            }
            if (this.txtcphone.Text.Trim().Length == 0)
            {
                strErr += "cphone不能为空!\\n";
            }
            //if(this.txtcemail.Text.Trim().Length==0)
            //{
            //	strErr+="cemail不能为空!\\n";
            //}
            if (this.txtclevel.Text.Trim().Length == 0)
            {
                strErr += "clevel不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtcsum.Text) && !PageValidate.IsDecimal(txtcsum.Text))
            {
                strErr += "csum格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtcsex.Text))
            {
                strErr += "csex格式错误!\\n";
            }
            if (this.txtcremark.Text.Trim().Length == 0)
            {
                strErr += "cremark不能为空!\\n";
            }

            /*
             *          if(this.txtcss1.Text.Trim().Length==0)
             *          {
             *                  strErr+="css1不能为空!\\n";
             *          }
             *          if(this.txtcss2.Text.Trim().Length==0)
             *          {
             *                  strErr+="css2不能为空!\\n";
             *          }
             *          if(this.txtcss3.Text.Trim().Length==0)
             *          {
             *                  strErr+="css3不能为空!\\n";
             *          }
             *          if(this.txtcss4.Text.Trim().Length==0)
             *          {
             *                  strErr+="css4不能为空!\\n";
             *          }
             *          if(this.txtcss5.Text.Trim().Length==0)
             *          {
             *                  strErr+="css5不能为空!\\n";
             *          }
             *          if(!PageValidate.IsNumber(txtcsd1.Text))
             *          {
             *                  strErr+="csd1格式错误!\\n";
             *          }
             *          if(!PageValidate.IsNumber(txtcsd2.Text))
             *          {
             *                  strErr+="csd2格式错误!\\n";
             *          }
             *          if(!PageValidate.IsNumber(txtcsd3.Text))
             *          {
             *                  strErr+="csd3格式错误!\\n";
             *          }
             *          if(!PageValidate.IsNumber(txtcsd4.Text))
             *          {
             *                  strErr+="csd4格式错误!\\n";
             *          }
             *          if(!PageValidate.IsNumber(txtcsd5.Text))
             *          {
             *                  strErr+="csd5格式错误!\\n";
             *          }
             *          if(!PageValidate.IsDecimal(txtcsdc1.Text))
             *          {
             *                  strErr+="csdc1格式错误!\\n";
             *          }
             *          if(!PageValidate.IsDecimal(txtcsdc2.Text))
             *          {
             *                  strErr+="csdc2格式错误!\\n";
             *          }
             *          if(!PageValidate.IsDecimal(txtcsdc3.Text))
             *          {
             *                  strErr+="csdc3格式错误!\\n";
             *          }
             *          if(!PageValidate.IsDecimal(txtcsdc4.Text))
             *          {
             *                  strErr+="csdc4格式错误!\\n";
             *          }
             *          if(!PageValidate.IsDecimal(txtcsdc5.Text))
             *          {
             *                  strErr+="csdc5格式错误!\\n";
             *          }
             */

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string  cname   = this.txtcname.Text;
            string  ccode   = this.txtccode.Text;
            string  cphone  = this.txtcphone.Text;
            string  cemail  = this.txtcemail.Text;
            string  clevel  = this.txtclevel.Text;
            decimal csum    = decimal.Parse(this.txtcsum.Text);
            int     csex    = int.Parse(this.txtcsex.Text);
            string  cremark = this.txtcremark.Text;

            //string css1=this.txtcss1.Text;
            //string css2=this.txtcss2.Text;
            //string css3=this.txtcss3.Text;
            //string css4=this.txtcss4.Text;
            //string css5=this.txtcss5.Text;
            //int csd1=int.Parse(this.txtcsd1.Text);
            //int csd2=int.Parse(this.txtcsd2.Text);
            //int csd3=int.Parse(this.txtcsd3.Text);
            //int csd4=int.Parse(this.txtcsd4.Text);
            //int csd5=int.Parse(this.txtcsd5.Text);
            //decimal csdc1=decimal.Parse(this.txtcsdc1.Text);
            //decimal csdc2=decimal.Parse(this.txtcsdc2.Text);
            //decimal csdc3=decimal.Parse(this.txtcsdc3.Text);
            //decimal csdc4=decimal.Parse(this.txtcsdc4.Text);
            //decimal csdc5=decimal.Parse(this.txtcsdc5.Text);

            Jium.Model.consumer model = new Jium.Model.consumer();
            model.cname   = cname;
            model.ccode   = ccode;
            model.cphone  = cphone;
            model.cemail  = cemail;
            model.clevel  = clevel;
            model.csum    = csum;
            model.csex    = csex;
            model.cremark = cremark;
            model.csd1    = 5;
            model.csd5    = 5;
            //model.css1=css1;
            //model.css2=css2;
            //model.css3=css3;
            //model.css4=css4;
            //model.css5=css5;
            //model.csd1=csd1;
            //model.csd2=csd2;
            //model.csd3=csd3;
            //model.csd4=csd4;
            //model.csd5=csd5;
            //model.csdc1=csdc1;
            //model.csdc2=csdc2;
            //model.csdc3=csdc3;
            //model.csdc4=csdc4;
            //model.csdc5=csdc5;

            Jium.BLL.consumer bll = new Jium.BLL.consumer();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
예제 #6
0
        protected void btnConfirmSale_Click(object sender, EventArgs e)
        {
            try
            {
                //#warning 代码生成警告:请检查确认真实主键的名称和类型是否正确
                string orderid  = DateTime.Now.ToString("yyyyMMddHHmmss");
                var    lstModel = new List <Jium.Model.piorecord>();

                for (int i = 0; i < gridViewBuy.Rows.Count; i++)
                {
                    var model = new Jium.Model.piorecord();
                    model.pcode      = gridViewBuy.Rows[i].Cells[0].Text;
                    model.pios3      = gridViewBuy.Rows[i].Cells[1].Text;
                    model.psaleprice = decimal.Parse(gridViewBuy.Rows[i].Cells[3].Text);
                    model.pcnt       = int.Parse(gridViewBuy.Rows[i].Cells[5].Text);
                    model.pzekou     = decimal.Parse(gridViewBuy.Rows[i].Cells[6].Text);
                    model.psalerid   = 0;
                    model.ptype      = (int)PRODUCT_IO_TYPE.SALE;;
                    model.ptime      = orderid;
                    model.pguestid   = int.Parse(txtCcode.Text);
                    var txtNum = gridViewBuy.Rows[i].Cells[4].Text.Trim();
                    model.piod1 = string.IsNullOrWhiteSpace(txtNum.Replace("&nbsp;", "")) ? 0 : int.Parse(gridViewBuy.Rows[i].Cells[4].Text); //服务
                    model.pios4 = gridViewBuy.Rows[i].Cells[2].Text.Replace("&nbsp;", "");                                                    //单位
                    model.piod5 = 5;                                                                                                          //model.pios5 = cells[i, 0].StringValue.Trim();//系列
                    model.pios1 = "销售";
                    lstModel.Add(model);
                }
                ERR_CODE iRes = ERR_CODE.SUCCESS;
                ///事务回滚机制???
                var bllCustomeService = new Jium.BLL.consumerservice();
                foreach (var model in lstModel)
                {
                    if (!Ctrl.piorecord.AddPiorecord(model))
                    {
                        iRes = ERR_CODE.FAIL;
                        break;
                    }
                    if (model.piod1 > 0)//add service for guset
                    {
                        var consumerservice = new Jium.Model.consumerservice();
                        consumerservice.ccode      = model.pguestid.ToString();
                        consumerservice.csnum      = model.piod1 ?? 0;
                        consumerservice.cstype     = model.pios3;
                        consumerservice.csleft     = model.piod1 ?? 0;
                        consumerservice.csiostatus = 0;
                        consumerservice.cstime0    = orderid;
                        consumerservice.csd5       = "5";
                        bllCustomeService.Add(consumerservice);
                    }
                }
                //update guest info
                var consumerBll = new Jium.BLL.consumer();
                var lstConsumer = consumerBll.GetModelList(string.Format("ccode='{0}' and csd5=5", txtCcode.Text.Trim()));
                if (lstConsumer.Count == 0)
                {
                    ///error
                    ///return;
                }
                lstConsumer[0].css1   = orderid;
                lstConsumer[0].csum  += decimal.Parse(txtSumReal.Text);
                lstConsumer[0].clevel = Jium.BLL.consumer.getLevelByConsume(lstConsumer[0].csum).ToString();//get from csum
                consumerBll.Update(lstConsumer[0]);

                Maticsoft.Common.MessageBox.ShowAndRedirects(this, "操作完成!", "/default.aspx");
            }
            catch (Exception ex)
            {
                Maticsoft.Common.MessageBox.Show(this, "系统错误:" + ex.Message);
                return;
            }
        }