Exemple #1
0
        private void btnMemoAdd_Click(object sender, EventArgs e)
        {
            string memo = txtMemo.Text.Trim();

            if (string.IsNullOrEmpty(memo))
            {
                return;
            }
            if (string.IsNullOrEmpty(this.CustomerID))
            {
                MessageBox.Show("客户不存在,无法添加!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            this.btnMemoAdd.Enabled = false;
            DataEntity.XMLSchema.CustomerQueryRecords query = new CustomerQueryRecords();
            query.CustomerID   = this.CustomerID;
            query.OperaterID   = Options.GlobalVar.B2CUserID.Split(':')[0];
            query.Tel          = this.txtPhoneQuery.Text.Trim();
            query.QueryContent = memo;
            query.QueryTime    = DateTime.Now.ToString();
            string xml = new TXIO.XML_IO().SaveToText(query);

            if (ws.InputCustomerQuery(xml))
            {
                string        date  = DateTime.Now.ToString();
                ListViewGroup group = this.lvMemo.Groups.Add(date, date);
                ListViewItem  item  = new ListViewItem(memo);
                item.Group    = group;
                item.Selected = true;
                this.lvMemo.Items.Add(item);
                item.EnsureVisible();

                this.txtMemo.Text = string.Empty;
            }
            else
            {
                MessageBox.Show("添加备注信息失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            this.btnMemoAdd.Enabled = true;
        }
Exemple #2
0
        private void btOrderAdd_Click(object sender, EventArgs e)
        {
            DataEntity.XMLSchema.TicketOrder order = new DataEntity.XMLSchema.TicketOrder();
            order.TicketOrderCode      = txtPnr.Text;                              //订单编码
            order.CustomerID           = txtCustomID.Text.Split(':')[0];           //客户ID
            order.DepartmentID         = txtAgentID.Text.Split(':')[0];            //票务公司ID
            order.ReturnMoneyType      = txtFanyong.Text.Split(':')[0];            //返俑方式
            order.CAACOrderCode        = txtHXorderNo.Text;                        //民航订单号
            order.IsAccumulate         = cbJiFen.Checked ? "1" : "0";              //是否参与积分
            order.ContactorName        = txtTouchName.Text;                        //联系人
            order.ContactorMobile      = txtTouchMobile.Text;                      //联系人手机
            order.ContactorTel         = txtTouchPhone.Text;                       //联系人电话
            order.ContactorEmail       = txtTouchEmail.Text;                       //联系人电子邮件
            order.DeliveryTypeID       = cbSendTicketMethod.Text.Split(':')[0];    //送票方式
            order.DeliveryAddr         = txtSendAddress.Text;                      //送票地址
            order.DeliveryDeadlineTime = dtpSend.Value.ToString();                 //送票截至时间
            order.DeliveryDeparmentID  = txtSenderPart.Text.Split(':')[0];         //送票机构
            order.PaymentTypeID        = cbJieSuanMethod.Text.Split(':')[0];       //结算方式
            order.OperateTypeID        = this.cbOperationType.Text.Split(':')[0];  //操作类型ID
            order.InsuranceTypeID      = this.cbInsuraceTypeID.Text.Split(':')[0]; //保险类型ID
            order.OrderType            = this.cbOrderType.Text.Split(':')[0];      //订单类型
            order.Remark      = txtRemark.Text;                                    //备注
            order.LinkPRN     = txtPnr2.Text == "多个逗号隔开" ? "" : txtPnr2.Text;      //关联PNR
            order.AttachMoney = txtOtherFee.Text;                                  //杂费

//            string xml1 = @"<TicketOrderCode>#订单编码#</TicketOrderCode><CustomerID>#客户ID#</CustomerID><DepartmentID>#票务公司ID#</DepartmentID>
//                <ReturnMoneyType>#返俑方式#</ReturnMoneyType><CAACOrderCode>#民航订单号#</CAACOrderCode><IsAccumulate>#是否参与积分#</IsAccumulate>
//                <ContactorName>#联系人#</ContactorName><ContactorMobile>#联系人手机#</ContactorMobile><ContactorTel>#联系人电话#</ContactorTel>
//                    <ContactorEmail>#联系人电子邮件#</ContactorEmail><DeliveryTypeID>#送票方式#</DeliveryTypeID><DeliveryAddr>#送票地址#</DeliveryAddr>
//                        <DeliveryDeadlineTime>#送票截至时间#</DeliveryDeadlineTime><DeliveryDeparmentID>#送票机构#</DeliveryDeparmentID>
//                            <PaymentTypeID>#结算方式#</PaymentTypeID><OperateTypeID>#操作类型ID#</OperateTypeID>
//                                <InsuranceTypeID>#保险类型ID#</InsuranceTypeID><OrderType>#订单类型#</OrderType><Remark>#备注#</Remark>
//                                    <LinkPRN>#关联PNR#</LinkPRN><AttachMoney>#杂费#</AttachMoney>";

//            string xmltemp = @"<Airline><AirlineCode>#航班号#</AirlineCode><TakeOffDay>#起飞日期#</TakeOffDay><PositionsType>#舱位类型#</PositionsType>
//                <AirportTax>#机场税#</AirportTax><OilTax>#燃油税#</OilTax><TakeOffTime>#起飞时间#</TakeOffTime><ArrivedTime>#到达时间#</ArrivedTime>
//<TakeOffCity>#起飞城市#</TakeOffCity><ArrivedCity>#到达城市#</ArrivedCity><PlanType>#机型#</PlanType><StopStation>#StopStation#</StopStation>
//<AirLineCorpName>#航空公司名称#</AirLineCorpName><SalePrice>#SalePrice#</SalePrice><AirLineIndex>#AirLineIndex#</AirLineIndex>
//<DisCount>#折扣#</DisCount></Airline>";
//            string xml2 = "<Airlines>";

            for (int i = 0; i < 10; i++)
            {
                int no = i * 14 + 13;
                if (groupBox2.Controls["textBox" + no.ToString()].Text.Trim() == "")
                {
                    continue;
                }

                DataEntity.XMLSchema.Airline airline = new DataEntity.XMLSchema.Airline();
                airline.AirlineCode     = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();              //航班号
                airline.TakeOffDay      = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();              //起飞日期
                airline.PositionsType   = groupBox2.Controls["textBox" + string.Format("{0}", (no))].Text.Trim()[0].ToString();  //舱位类型
                airline.DisCount        = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim().Substring(1); //折扣
                airline.AirportTax      = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();              //机场税
                airline.OilTax          = "0"; no++;                                                                             // groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();//燃油税
                airline.TakeOffTime     = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();              //起飞时间
                airline.ArrivedTime     = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();              //到达时间
                airline.TakeOffCity     = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();              //起飞城市
                airline.ArrivedCity     = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();              //到达城市
                airline.PlanType        = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();              //机型
                airline.StopStation     = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();              //StopStation
                airline.AirLineCorpName = airline.AirlineCode.Substring(0, 2);                                                   //航空公司名称
                airline.SalePrice       = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();              //SalePrice
                airline.AirLineIndex    = groupBox2.Controls["textBox" + string.Format("{0}", (no++))].Text.Trim();              //AirLineIndex

                int index = airline.ArrivedTime.LastIndexOf(':');
                if (index > 0)
                {
                    airline.ArrivedTime = airline.ArrivedTime.Substring(0, index);
                }

                index = airline.TakeOffTime.LastIndexOf(':');
                if (index > 0)
                {
                    airline.TakeOffTime = airline.TakeOffTime.Substring(0, index);
                }

                order.Airlines.Add(airline);
            }

//            xml2 += "</Airlines>";

//            xmltemp = @"<Ticket><TicketType>#乘客类型#</TicketType><PassengerName>#乘客姓名#</PassengerName><CardID>#证件号码#</CardID>
//<CardType>#证件类型#</CardType><TicketNo>#票号#</TicketNo><PaymentPrice>#结算价#</PaymentPrice><SalePrice>#销售价#</SalePrice>
//<HandBackPrice>#退票费#</HandBackPrice><InsuranceType>#保险产品类型#</InsuranceType><InsuranceBasicPrice>#保险底价#</InsuranceBasicPrice>
//<InsuranceSalePrice>#保险售价#</InsuranceSalePrice><IsFreeInsurance>#是否赠送保险#</IsFreeInsurance><Status>#票的状态#</Status>
//<TicketConfigID>#政策配置ID#</TicketConfigID><IsBuy>#IsBuy#</IsBuy><IsEspecial>#IsEspecial#</IsEspecial><Backhander>#返利#</Backhander>
//<Tax>#税费#</Tax></Ticket>";
//            string xml3 = "<Tickets>";

            for (int i = 0; i < peopleCount; i++)
            {
                DataEntity.XMLSchema.Ticket ticket = new DataEntity.XMLSchema.Ticket();

                ticket.TicketType          = dataGridView1[0, i].Value.ToString().Split(':')[0];                    //乘客类型
                ticket.PassengerName       = dataGridView1[1, i].Value.ToString();                                  //乘客姓名
                ticket.CardID              = dataGridView1[2, i].Value.ToString();                                  //证件号码
                ticket.CardType            = dataGridView1[3, i].Value.ToString().Split(':')[0];                    //证件类型
                ticket.TicketNo            = dataGridView1[4, i].Value.ToString();                                  //票号
                ticket.PaymentPrice        = dataGridView1[5, i].Value.ToString();                                  //结算价
                ticket.SalePrice           = dataGridView1[6, i].Value.ToString();                                  //销售价
                ticket.HandBackPrice       = dataGridView1[7, i].Value.ToString();                                  //退票费
                ticket.InsuranceType       = dataGridView1[8, i].Value.ToString();                                  //保险产品类型
                ticket.InsuranceBasicPrice = dataGridView1[9, i].Value.ToString();                                  //保险底价
                ticket.InsuranceSalePrice  = dataGridView1[10, i].Value.ToString();                                 //保险售价
                ticket.IsFreeInsurance     = (bool)dataGridView1[11, i].Value ? "1" : "0";                          //是否赠送保险
                ticket.Status              = dataGridView1[12, i].Value.ToString();                                 //票的状态
                ticket.TicketConfigID      = dataGridView1[13, i].Value.ToString();                                 //政策配置ID
                ticket.IsBuy      = (bool)dataGridView1[14, i].Value ? "1" : "0";                                   //IsBuy
                ticket.IsEspecial = (bool)dataGridView1[15, i].Value ? "1" : "0";                                   //IsEspecial
                ticket.Backhander = (bool)dataGridView1[11, i].Value ? "0" : dataGridView1[16, i].Value.ToString(); //返利
                ticket.Tax        = dataGridView1[17, i].Value.ToString();                                          //税费

                order.Tickets.Add(ticket);
            }
            //xml3 += "</Tickets>";
            //string xml = "<TicketOrder>" + xml1 + xml2 + xml3 + "</TicketOrder>";

            try
            {
                int    clearid = int.Parse(cbClearID.Text.Split(':')[0]);
                string xml     = new TXIO.XML_IO().SaveToText(order);
                int    ret     = ws.NewTicketsOrder(xml, int.Parse(Options.GlobalVar.B2CUserID), clearid);

                switch (ret)
                {
                case -1:
                    throw new Exception("XML格式不正确!");

                case -2:
                    throw new Exception("操作员不存在!");

                case -3:
                    throw new Exception("业务员不存在!");

                case -4:
                    throw new Exception("服务器数据库发生错误!");

                case -5:
                    throw new Exception("PNR 重复(七天内),且该 PNR 对应订单不是废单!");

                default:
                    Options.GlobalVar.B2CNewOrderID = ret;
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "提交订单", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #3
0
        private void btSaveCost_Click(object sender, EventArgs e)
        {
            btnSaveCustomer.Enabled = false;
            string name       = txtName.Text.Trim();
            string customerNo = txtCustomerNo.Text.Trim();
            string tel        = cmbLandline.Text.Trim();

            if (string.IsNullOrEmpty(name))
            {
                errorProvider1.SetError(txtName, "名字不能为空!");
                return;
            }
            else
            {
                errorProvider1.SetError(txtName, "");
            }

            if (string.IsNullOrEmpty(tel))
            {
                errorProvider1.SetError(cmbLandline, "联系电话不能为空!");
                return;
            }
            else
            {
                errorProvider1.SetError(cmbLandline, "");
            }

            DataEntity.XMLSchema.NewCustomers customer = new DataEntity.XMLSchema.NewCustomers();
            customer.CustomerName   = name;
            customer.CustomerCode   = customerNo;
            customer.CardID         = cmbIdentity.Text.Trim();
            customer.DepartmentID   = Options.GlobalVar.B2CDepartmentID.Split(':')[0];
            customer.OperaterID     = Options.GlobalVar.B2CUserID.Split(':')[0];
            customer.Sex            = this.rbMale.Checked ? "0" : "1";
            customer.AccumulatedNum = "0";
            customer.VIPcard        = txtSepcialNo.Text.Trim();
            customer.IsInceptSMS    = cbSMS.Checked ? "true" : "false";
            //if (tel.Length >= 11)
            customer.Mobile = tel;
            //else
            //    customer.Tel = tel;//B2C后台已取消该字段

            string xml = new TXIO.XML_IO().SaveToText(customer);

            try
            {
                int ret = ws.NewCustomer(xml);

                switch (ret)
                {
                case -1:
                    //MessageBox.Show("改来电客户已经存在!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    DataEntity.XMLSchema.UpdateCustomer cus = new UpdateCustomer();
                    cus.CustomerName = customer.CustomerName;
                    cus.CardID       = customer.CardID;
                    cus.IsInceptSMS  = Convert.ToInt32(cbSMS.Checked).ToString();
                    cus.Sex          = customer.Sex;// customer.Sex;
                    cus.VIPcard      = customer.VIPcard;

                    string xmlUpdate = new TXIO.XML_IO().SaveToText(cus);
                    string retUpdate = ws.UpdateCustomer(int.Parse(this.CustomerID), xmlUpdate);
                    switch (retUpdate)
                    {
                    case "1":
                        MessageBox.Show("更新客户资料成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        break;

                    case "-1":
                        MessageBox.Show("客户不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        break;

                    case "0":
                        MessageBox.Show("更新客户资料发生错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        break;
                    }
                    break;

                case -2:
                    MessageBox.Show("数据库错误,保存失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    break;

                default:
                    MessageBox.Show("客户资料保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.CustomerID = ret.ToString();
                    Options.GlobalVar.B2CCallingXml = ws.GetCustomerByPhone(phoneNumber);
                    break;
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show("保存客户资料发生错误,详细内容如下:" + System.Environment.NewLine + System.Environment.NewLine
                                + ee.Message + System.Environment.NewLine + System.Environment.NewLine
                                + "[" + ws.Url + "]",
                                "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            btnSaveCustomer.Enabled = true;
        }