Ejemplo n.º 1
0
        private void btnprovbill_Click(object sender, RoutedEventArgs e)
        {
            Checkout1 co = new Checkout1();

            co.ROOM_NO = roomno;
            d1         = co.guestinfo();
            d2         = co.ROOMCATEGORY();
            d3         = co.checkoutdetails();
            d4         = co.company_contact();
            id         = co.get_checkout_id();
            // ********** For Report *******************
            // ReportDocument rrr = new ReportDocument();
            //rrr.Load("../../Checkoutreport.rpt");
            // Checkout1 co1 = new Checkout1();
            // DataTable hotel2 = co1.GET_HOTELADDRESS();
            //rrr.Subreports[0].SetDataSource(hotel2);
            //rrr.SetDataSource(Checkout1.dt);
            //rrr.PrintToPrinter(1, false, 0, 0);
        }
Ejemplo n.º 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);
        }