예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void no_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (txtfirstname.Text == null && txtlastname.Text == null && ADDRESS.Text == null && ZIP.Text == null && txtcity.Text == null && txtmobileno.Text == null && idproof.Text == null && txtproof.Text == null && txtpax.Text == null && txtadult.Text == null && txtchild.Text == null && txtextrabed.Text == null && EADULT.Text == null && ECHILD.Text == null && TAXPER.Text == null && RACKTARRIF.Text == null && RACKCHILD.Text == null && RACKADULT.Text == null && CHARGETARRIF.Text == null && CHARGEADULT.Text == null && CHARGECHILD.Text == null)
         {
             //MessageBox.Show("FILL ALL COLUMNS");
             pop1.IsOpen = true;
         }
         else
         {
             int a  = Convert.ToInt32(txtadult.Text);
             int b  = Convert.ToInt32(txtchild.Text);
             int cv = a + b;
             if (txtpax.Text == cv.ToString())
             {
                 ADVANCE      = 0;
                 popup.IsOpen = false; ADVANCEPOPUP.IsOpen = false;
                 ch.INSERT();
                 //ch.adavance();
                 //ch.advanceupdate();
                 //ch.INSERT_POST();
                 ch.Night_Audit();
                 //ch.updateroomstatus();
                 if (RESERVSTIONCHECKIN.p == 1)
                 {
                     ch.RESERVATIONINT();
                 }
                 //ch.postcharges();
                 popup_insert.IsOpen = true;
                 Send_SMS();
                 Send_sms2();
             }
             else
             {
                 popup.IsOpen = false;
                 MessageBox.Show("Adults AND Childs ARE Greterthen PAX ");
                 txtpax.Text       = "";
                 txtadult.Text     = "";
                 txtchild.Text     = "";
                 txtextrabed.Text  = "";
                 EADULT.Text       = "";
                 ECHILD.Text       = "";
                 plancode.Text     = "";
                 TAXPER.Text       = "";
                 RACKTARRIF.Text   = "";
                 RACKADULT.Text    = "";
                 RACKCHILD.Text    = "";
                 CHARGETARRIF.Text = "";
                 CHARGEADULT.Text  = "";
                 CHARGECHILD.Text  = "";
             }
         }
     }
     catch (Exception) { }
 }
예제 #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (error != 0 || txtfirstname.Text == "" || txtlastname.Text == "" || ADDRESS.Text == "" || ZIP.Text == "" || txtcity.Text == "" || txtmobileno.Text == "")
                {
                    pop1.IsOpen = true;
                    if (txtfirstname.Text == "")
                    {
                        txtfirstname.Text = "";
                    }
                    if (txtlastname.Text == "")
                    {
                        txtlastname.Text = "";
                    }
                    if (ADDRESS.Text == "")
                    {
                        ADDRESS.Text = "";
                    }
                    if (ZIP.Text == "")
                    {
                        ZIP.Text = "";
                    }
                    if (txtcity.Text == "")
                    {
                        txtcity.Text = "";
                    }
                    if (txtmobileno.Text == "")
                    {
                        txtmobileno.Text = "";
                    }
                    //if(txtpax.Text=="")
                    //{ txtpax.Text = ""; }
                    //if(txtadult.Text =="")
                    //{ txtadult.Text = ""; }
                }
                else
                {
                    pop1.IsOpen = false;
                    for (int i = 0; i < dt1.Rows.Count; i++)
                    {
                        r = dt.NewRow();
                        if (RESERVSTIONCHECKIN.p == 1)
                        {
                            r["reservationid"] = RESERVSTIONCHECKIN.res_id;
                            gc.RESERVATION_ID  = RESERVSTIONCHECKIN.res_id;
                        }
                        else
                        {
                            r["reservationid"] = "0";
                            gc.RESERVATION_ID  = "0";
                        }
                        r["groupcheckin"] = tbgckn.Text;
                        r["roomno"]       = dt1.Rows[i]["room"].ToString();
                        r["roomtype"]     = catego[i];
                        DateTime d = Convert.ToDateTime(arrival.Content);
                        r["arrival"] = d.ToShortDateString();
                        r["atime"]   = d.ToShortTimeString();
                        DateTime dd = DateTime.Today.AddDays(GroupCheckinDeparture.days);
                        r["departure"]   = dd.ToShortDateString();
                        r["suffix"]      = select.Text;
                        r["firstname"]   = txtfirstname.Text;
                        r["lastname"]    = txtlastname.Text;
                        r["address"]     = ADDRESS.Text;
                        r["zip"]         = ZIP.Text;
                        r["city"]        = txtcity.Text;
                        r["state"]       = txtstate.Text;
                        r["country"]     = txtcountry.Text;
                        r["idproof"]     = idproof.Text;
                        r["iddata"]      = txtproof.Text;
                        r["mobileno"]    = txtmobileno.Text;
                        r["email"]       = txtemail.Text;
                        r["pax"]         = txtpax.Text;
                        r["paxadult"]    = dt1.Rows[i]["adult"];
                        r["paxchild"]    = dt1.Rows[i]["child"];
                        r["adult"]       = dt1.Rows[i]["adult"];
                        r["child"]       = dt1.Rows[i]["child"];
                        r["racktarrif"]  = dt1.Rows[i]["rtarrif"];
                        r["rextraadult"] = dt1.Rows[i]["radult"];
                        r["rextrachild"] = dt1.Rows[i]["rchild"];
                        r["chartarrif"]  = dt1.Rows[i]["ctarrif"];
                        r["cextraadult"] = dt1.Rows[i]["cadult"];
                        r["cextrachild"] = dt1.Rows[i]["cchild"];
                        r["plancode"]    = dt1.Rows[i]["plan"];
                        r["tax"]         = dt1.Rows[i]["tax"];
                        r["status"]      = status.Text;
                        r["scantry"]     = scantybaggage.Text;
                        r["market"]      = txtmarketseg.Content;
                        dt.Rows.Add(r);
                    }
                    if (Convert.ToInt32(gc.RESERVATION_ID) > 0)
                    {
                        DataTable dt_ad_amount = gc.GetAdvanceAmount();
                        if (dt_ad_amount.Rows[0]["AMOUNT_RECEIVED"].ToString() == "0.00" || dt_ad_amount.Rows[0]["AMOUNT_RECEIVED"].ToString() == null || dt_ad_amount.Rows[0]["AMOUNT_RECEIVED"].ToString() == "")
                        {
                            AdvanceAmount = 0;
                        }
                        else
                        {
                            AdvanceAmount    = Convert.ToDecimal(dt_ad_amount.Rows[0]["AMOUNT_RECEIVED"]);
                            SubAdvanceAmount = Math.Round((AdvanceAmount / NoOfRooms), 2, MidpointRounding.AwayFromZero);
                        }
                    }
                    for (int l = 0; l < dt.Rows.Count; l++)
                    {
                        gc.RESERVATION_ID  = dt.Rows[l]["reservationid"].ToString();
                        gc.GROUP_CHECKINID = dt.Rows[l]["groupcheckin"].ToString();
                        gc.ROOM_NO         = dt.Rows[l]["roomno"].ToString();
                        gc.ROOM_CATEGORY   = dt.Rows[l]["roomtype"].ToString();
                        gc.ARRIVAL_DATE    = dt.Rows[l]["arrival"].ToString();
                        gc.ARRIVAL_TIME    = dt.Rows[l]["atime"].ToString();
                        gc.DEPARTURE_DATE  = dt.Rows[l]["departure"].ToString();
                        gc.SUFFIX          = dt.Rows[l]["suffix"].ToString();
                        gc.FIRST_NAME      = dt.Rows[l]["firstname"].ToString();
                        gc.LAST_NAME       = dt.Rows[l]["lastname"].ToString();
                        gc.ADDRESS         = dt.Rows[l]["address"].ToString();
                        gc.ZIP             = dt.Rows[l]["zip"].ToString();
                        gc.CITY            = dt.Rows[l]["city"].ToString();
                        gc.STATE           = dt.Rows[l]["state"].ToString();
                        gc.COUNTRY         = dt.Rows[l]["country"].ToString();
                        gc.MOBILE_NO       = dt.Rows[l]["mobileno"].ToString();
                        gc.EMAIL           = dt.Rows[l]["email"].ToString();
                        gc.ID_PROOF        = dt.Rows[l]["idproof"].ToString();
                        //gc.ID_DATA = dt.Rows[l]["iddata"].ToString();
                        gc.ID_DATA  = txtproof.Text;
                        gc.PAX      = txtpax.Text;
                        gc.PAXADULT = txtadult.Text;
                        gc.PAXCHILD = txtchildd.Text;
                        int r = int.Parse(txtadult.Text) + int.Parse(txtchildd.Text);
                        gc.TEXTRABED     = r.ToString();
                        gc.EXTRABEDADULT = dt.Rows[l]["adult"].ToString();
                        gc.EXTRABEDCHILD = dt.Rows[l]["child"].ToString();
                        gc.PLANCODE      = dt.Rows[l]["plancode"].ToString();
                        ch.FETCH_TAX(dt.Rows[l]["racktarrif"].ToString());
                        gc.TAX = ch.TAX;
                        //gc.TAX = dt.Rows[l]["tax"].ToString();
                        gc.RACK_TARIFF    = Convert.ToDecimal(dt.Rows[l]["racktarrif"].ToString());
                        gc.RACK_ADULT     = Convert.ToDecimal(dt.Rows[l]["rextraadult"].ToString());
                        gc.RACK_CHILD     = Convert.ToDecimal(dt.Rows[l]["rextrachild"].ToString());
                        gc.CHARGED_TARIFF = Convert.ToDecimal(dt.Rows[l]["chartarrif"].ToString());
                        gc.CHARGED_ADULT  = dt.Rows[l]["cextraadult"].ToString();
                        gc.CHARGED_CHILD  = dt.Rows[l]["cextrachild"].ToString();
                        gc.MARKET         = dt.Rows[l]["market"].ToString();
                        gc.SCANTRY        = dt.Rows[l]["scantry"].ToString();
                        gc.STATUS         = dt.Rows[l]["status"].ToString();

                        gc.Insert1();
                        gc.coloruppdate();
                        gc.Night_Insert();
                        if (AdvanceAmount > 0)
                        {
                            if (l == 0)
                            {
                                gc.SplitedAdvance = SubAdvanceAmount.ToString();
                                gc.AdvanceUpdate();
                            }
                            else
                            {
                                gc.SplitedAdvance = SubAdvanceAmount.ToString();
                                gc.InsertAdvance();
                            }
                        }
                        gc.RESERID = RESERVSTIONCHECKIN.res_id;
                        gc.Updatereservtion();
                    }
                    if (RESERVSTIONCHECKIN.p == 1)
                    {
                        ch.RESERVATIONINT();
                    }
                    //  spin.Visibility = Visibility.Visible;
                    t.Interval = 5000; // 5 sec
                    t.Elapsed += timer_Elasped;
                    t.Start();
                    popup_insert.IsOpen = true;
                    //this.NavigationService.Refresh();
                    Button.IsEnabled = false;
                }
            }
            catch (Exception) { }
        }