Exemplo n.º 1
0
        public static void ConfrimBase(TravelItem item, string fileName)
        {
            string[] fieldNames = new string[]{
                "rtaName",
                "rtaPhone",
                "rtaFax",
                "rtaPrincipal",
                "otaConfimer",
                "date1",
                "date2"
            };

            object[] fieldValues = new object[]{
                item.Agency.AgencyName,
                item.Agency.AgencyPrincipalPhone,
                item.Agency.AgencyFax,
                item.Agency.AgencyPrincipal,
                item.Agency.AgencyPrincipal,
                item.TravelDate.ToString("yyyy 年 MM 月 dd 日"),
                item.TravelDate.ToString("yyyy 年 MM 月 dd 日")
            };

            var doc = new Document(tempFolder + "\\Confirmation.doc");
            doc.MailMerge.Execute(fieldNames, fieldValues);
            doc.Save(outputFolder + "\\" + fileName);
        }
        protected void TypeIn_Click(object sender, EventArgs e)
        {
            GetTravelControl();
            TravelItem item = new TravelItem();
            item.ItemGuid = Guid.NewGuid();
            item.TravelDate = this.TravelDate.SelectedDate;
            item.CreateDate = DateTime.Now;
            item.ContactName = this.ContactName.Text;
            //item.Peoples = new TravelPeoples();
            //item.Peoples.Adult = Convert.ToInt32(this.AdultCount.Text);
            //item.Peoples.Child = Convert.ToInt32(this.ChildCount.Text);
            //item.Peoples.Escort = Convert.ToInt32(this.EscortCount.Text);
            item.Introducer = this.Introducer.Text;
            item.Destination = this.Destination.Text;
            item.GroupType = this.GroupType.Text;
            item.Expenditure = new Expenditure();
            item.Expenditure.TicketLeave = this.TicketLeave.Text;
            item.Expenditure.TicketLeavePrice = Convert.ToDouble(this.TicketLeavePrice.Text);
            item.Expenditure.TicketReturn = this.TicketReturn.Text;
            item.Expenditure.TicketReturnPrice = Convert.ToDouble(this.TicketReturnPrice.Text);
            if (a_control.CreateTravelItem(item))
            {

            }
        }
 private void BindData(TravelItem item)
 {
     this.HideId.Text = item.Id.ToString();
     this.HideGuid.Text = item.ItemGuid.ToString();
     this.AgencyCode.Text = item.Agency == null ? string.Empty : item.Agency.AgencyCode;
     this.AgencyName.Text = item.Agency == null ? string.Empty : item.Agency.AgencyName;
     //this.AgencyPhone.Text = agency.AgencyPhones;
     //this.AgencyFax.Text = agency.AgencyFax;
     //this.AgencyPrincipal.Text = agency.AgencyPrincipal;
     //this.AgencyPrincipalPhone.Text = agency.AgencyPrincipalPhone;
     //this.AgencyAddress.Text = agency.AgencyAddress;
 }
 public void ExportWord(TravelItem item)
 {
     string fileName = Guid.NewGuid().ToString() + ".doc";
     string fileFolder = System.AppDomain.CurrentDomain.BaseDirectory + "Word";
     TravelWord.ConfrimBase(item, fileName);
     Context.Response.ContentType = "Application/msword";
     string s = fileFolder + "\\" + fileName;
     Response.WriteFile(s);
     Response.Write(fileName);
     Response.Flush();
     Response.Close();
 }
        protected void ui_itemButton_Click(object sender, EventArgs e)
        {
            TravelItem item = null;
            try
            {
                GetTravelItemControl();
                item = new TravelItem();
                item.ItemGuid = Guid.NewGuid();
                item.LastUpdateTime = item.CreateTime = DateTime.Now;

                item.CustomerName = this.ui_customerName.Text;
                item.CustomerPhone1 = this.ui_customerPhone1.Text;
                item.CustomerPhone2 = this.ui_customerPhone2.Text;
                //update
                item.TravelDate = DateTime.Now;//new DateTime(this.ui_travelDate.Text);
                item.StartLine = this.ui_tourRoute.Text;

                item.AdultPrice = Convert.ToDouble(this.ui_adultPrice.Text);
                item.AdultCount = Convert.ToInt32(this.ui_adultCount.Text);
                item.ChildPrice = Convert.ToDouble(this.ui_childPrice.Text);
                item.ChildCount = Convert.ToInt32(this.ui_childCount.Text);
                item.OtherPrice = Convert.ToDouble(this.ui_earnestOther.Text);
                item.OtherDescription = this.ui_earnestOtherDes.Text;
                item.TotalPrice = Convert.ToDouble(this.ui_earnestTotal.Text);
                item.InsteadReceive = Convert.ToDouble(this.ui_insteadReceive.Text);

                //item.Agency

                item.OnwardTicketPrice = Convert.ToDouble(this.ui_onwardTicket1.Text);
                item.OnwardServicePrice = Convert.ToDouble(this.ui_onwardServiceCharge1.Text);
                item.OnwardTicketPrice2 = Convert.ToDouble(this.ui_onwardTicket2.Text);
                item.OnwardServicePrice2 = Convert.ToDouble(this.ui_onwardServiceCharge2.Text);

                item.BackwardTicketPrice = Convert.ToDouble(this.ui_backwardTicket1.Text);
                item.BackwardServicePrice = Convert.ToDouble(this.ui_backwardServiceCharge1.Text);
                item.BackwardTicketPrice2 = Convert.ToDouble(this.ui_backwardTicket2.Text);
                item.BackwardServicePrice2 = Convert.ToDouble(this.ui_backwardServiceCharge2.Text);


            }
            catch (Exception)
            {
            }
        }
 public bool CreateTravelItem(TravelItem item)
 {
     bool success = true;
     try
     {
         using (var db = new EntryContext())
         {
             db.TravelItems.Add(item);
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         success = false;
         Logs.Error("CreateTravelItem Exception : " + ex.ToString());
     }
     return success;
 }
Exemplo n.º 7
0
        private void CompleteTravelItem(ref TravelItem item)
        {
            if (item.ItemGuid == new Guid())
            {
                item.ItemGuid = Guid.NewGuid();
                item.CreateTime = DateTime.Now;
            }
            item.LastUpdateTime = DateTime.Now;

            item.CreateDate = DateTime.Now;
            item.TravelDate = DateTime.Now;
            //foreach (var con in item.Peoples)
            //{
            //    con.ItemGuid = Guid.NewGuid();
            //    con.CreateTime = con.LastUpdateTime = DateTime.Now;
            //}
        }