Example #1
0
 private void yes_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (error != 0 || (rbroom.IsChecked == true && txtroomno.Text == "") || (rbresr.IsChecked == true && txtreservation.Text == ""))
         {
             pop2.IsOpen  = true;
             popup.IsOpen = false;
         }
         else
         {
             adv.ROOM_NO         = txtroomno.Text;
             adv.RESERVATION_NO  = txtreservation.Text;
             adv.PAYMENT_MODE    = cbpayment.Text;
             adv.CURRENCY_CODE   = txtcurrencycode.Text;
             adv.AMOUNT_RECEIVED = txtamountreceived.Text;
             adv.ONLINE_PAYMENT  = cbonlinepay.Text;
             adv.PARTICULARS     = txtparticulars.Text;
             adv.TRANSACTION_NO  = txttransactionno.Text;
             adv.CHEQUE_NO       = txtchequeno.Text;
             adv.RECEIPT_NO      = lblreceiptno.Content.ToString();
             // SS RR ii UU ii  11/15/2017
             //adv.USER_NAME = login.u;
             if (txtroomno.IsEnabled == true)
             {
                 adv.ADVANCE_FOR = "Room";
             }
             else if (rbresr.IsChecked == true)
             {
                 adv.ADVANCE_FOR = "Reservation";
             }
             adv.INSERT_BY   = login.u;
             adv.INSERT_DATE = DateTime.Today;
             string a1 = "Save", b1 = Convert.ToString(btnsave.Content);
             if (b1 == a1)
             {
                 adv.Insert();
                 //adv.A();
                 popup.IsOpen = false;
                 adv.company_contact();
                 cc = adv.COMPANY_CONTACT;
                 DataTable d = report();
                 advance1.dt = d;
                 //************For Report****************
                 ReportDocument r   = new ReportDocument();
                 Checkout1      co  = new Checkout1();
                 DataTable      hot = co.hotel();
                 crystal1 = hot;
                 r.Load("../../HOTELINFORMATION.rpt");
                 r.Load("../../ADVANCESREPORT.rpt");
                 advance1 advance = new advance1();
                 r.SetDataSource(advance1.dt);
                 r.Subreports[0].SetDataSource(crystal1);
                 r.PrintToPrinter(1, false, 0, 0);
                 r.Refresh();
                 btnsave.IsEnabled   = true;
                 btnsearch.IsEnabled = false;
                 clear();
                 btnsave.Content = "Save";
                 //MessageBox.Show("inserted sucessfully");
             }
             popup_insert.IsOpen = true;
             clear();
         }
         this.NavigationService.Refresh();
     }
     catch (Exception) { }
 }
Example #2
0
        public DataTable hotelprint()
        {
            co.ROOM_NO = roomno;
            d1         = co.guestinfo();
            id         = co.get_checkout_id() - 1;
            DataTable d = new DataTable();

            d.Columns.Add("Name", typeof(string));
            d.Columns.Add("Address1", typeof(string));
            d.Columns.Add("Gst", typeof(string));
            d.Columns.Add("TarrifTotal", typeof(decimal));
            d.Columns.Add("C.Gst", typeof(decimal));
            d.Columns.Add("S.Gst", typeof(decimal));
            d.Columns.Add("OtherCharges", typeof(decimal));
            d.Columns.Add("Total", typeof(decimal));
            d.Columns.Add("Advance", typeof(decimal));
            d.Columns.Add("Discount", typeof(decimal));
            d.Columns.Add("User", typeof(string));
            d.Columns.Add("BillNo", typeof(int));
            d.Columns.Add("GuestName", typeof(string));
            d.Columns.Add("RoomNo", typeof(int));
            d.Columns.Add("RoomType", typeof(string));
            d.Columns.Add("CheckInDate", typeof(DateTime));
            d.Columns.Add("CheckoutDate", typeof(DateTime));
            d.Columns.Add("StayDays", typeof(int));
            d.Columns.Add("Mobile", typeof(Int64));
            d.Columns.Add("Address", typeof(string));
            d.Columns.Add("City", typeof(string));
            d.Columns.Add("State", typeof(string));
            d.Columns.Add("Coutry", typeof(string));
            d.Columns.Add("PinCode", typeof(int));
            d.Columns.Add("Gst1", typeof(string));
            d.Columns.Add("Signature", typeof(string));
            d.Columns.Add("DiscountAmount", typeof(decimal));
            d.Columns.Add("Refund", typeof(decimal));
            d.Columns.Add("Transfer", typeof(decimal));
            d.Columns.Add("Company", typeof(string));
            d.Columns.Add("Time", typeof(DateTime));
            d.Columns.Add("PrintType", typeof(string));
            co.hotel();
            DataRow r = d.NewRow();

            r["Name"]         = Checkout1.N;
            r["Address1"]     = Checkout1.AD;
            r["Gst"]          = Checkout1.GS;
            r["TarrifTotal"]  = Ch_Tarrif;
            r["C.Gst"]        = Ch_CSGST;
            r["S.Gst"]        = Ch_CSGST;
            r["OtherCharges"] = Ch_Charges;
            r["Total"]        = Ch_PendingAmount;
            long dsq = Convert.ToInt64(Ch_PendingAmount);

            r["Advance"]        = Ch_Advance;
            r["Discount"]       = Ch_Total;
            r["User"]           = login.u;
            r["BillNo"]         = id;
            r["GuestName"]      = d1.Rows[0]["FIRSTNAME"];
            r["RoomNo"]         = roomno;
            r["RoomType"]       = d1.Rows[0]["ROOM_CATEGORY"].ToString();
            r["CheckInDate"]    = d1.Rows[0]["ARRIVAL_DATE"].ToString();
            r["Time"]           = d1.Rows[0]["ARRIVAL_TIME"].ToString();
            time.Text           = d1.Rows[0]["ARRIVAL_TIME"].ToString();
            r["CheckoutDate"]   = DateTime.Today.Date;
            r["StayDays"]       = count;
            r["Mobile"]         = d1.Rows[0]["MOBILE_NO"].ToString();
            r["Address"]        = d1.Rows[0]["ADDRESS"].ToString();
            r["City"]           = d1.Rows[0]["CITY"].ToString();
            r["State"]          = d1.Rows[0]["STATE"].ToString();
            r["Coutry"]         = d1.Rows[0]["COUNTRY"].ToString();
            r["PinCode"]        = d1.Rows[0]["ZIP"].ToString();
            r["Gst1"]           = 00000;
            r["Signature"]      = NumberToText(dsq);
            r["DiscountAmount"] = Ch_Discount;
            r["Refund"]         = Ch_Refunds;
            r["Transfer"]       = RC_TransferAmount;
            if (d1.Rows[0]["COMPANY_NAME"].ToString() == null || d1.Rows[0]["COMPANY_NAME"].ToString() == "" || d1.Rows[0]["COMPANY_NAME"].ToString() == "Select a Compny")
            {
                r["Company"] = d1.Rows[0]["Company_Gst"].ToString();
            }
            else
            {
                r["Company"] = d1.Rows[0]["Company_Gst"].ToString() + " (" + d1.Rows[0]["COMPANY_NAME"].ToString() + ")";
            }
            if (PrintType == 0)
            {
                r["PrintType"] = "Owner Copy";
            }
            else if (PrintType == 1)
            {
                r["PrintType"] = " ";
            }
            d.Rows.Add(r);
            return(d);
        }