Пример #1
0
 private void txtpax_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         DataTable d = ch.paxdetails();
         //if (RESERVSTIONCHECKIN.p == 1)
         //{
         //    if (Checksin.maxpax == 1)
         //    {
         //        RACKTARRIF.Text = d.Rows[0]["SINGLERATE_TARRIF"].ToString();
         //        RACKADULT.Text = d.Rows[0]["EXTRABED_ADULT"].ToString();
         //        RACKCHILD.Text = d.Rows[0]["EXTRABED_CHILD"].ToString();
         //        CHARGETARRIF.Text = d.Rows[0]["SINGLERATE_TARRIF"].ToString();
         //        if (RACKTARRIF.Text != "")
         //        {
         //            ch.FETCH_TAX(RACKTARRIF.Text);
         //            TAXPER.Text = ch.TAX;
         //        }
         //        else
         //        {
         //            TAXPER.Text = "0.00";
         //        }
         //    }
         //    else if (Checksin.maxpax == 2)
         //    {
         //        RACKTARRIF.Text = d.Rows[0]["DOUBLERATE_TARRIF"].ToString();
         //        RACKADULT.Text = d.Rows[0]["EXTRABED_ADULT"].ToString();
         //        RACKCHILD.Text = d.Rows[0]["EXTRABED_CHILD"].ToString();
         //        CHARGETARRIF.Text = d.Rows[0]["DOUBLERATE_TARRIF"].ToString();
         //        if (RACKTARRIF.Text != "")
         //        {
         //            ch.FETCH_TAX(RACKTARRIF.Text);
         //            TAXPER.Text = ch.TAX;
         //        }
         //        else
         //        {
         //            TAXPER.Text = "0.00";
         //        }
         //    }
         //    else if (Checksin.maxpax == 3)
         //    {
         //        RACKTARRIF.Text = d.Rows[0]["TRIPLERATE_TARRIF"].ToString();
         //        RACKADULT.Text = d.Rows[0]["EXTRABED_ADULT"].ToString();
         //        RACKCHILD.Text = d.Rows[0]["EXTRABED_CHILD"].ToString();
         //        CHARGETARRIF.Text = d.Rows[0]["TRIPLERATE_TARRIF"].ToString();
         //        if (RACKTARRIF.Text != "")
         //        {
         //            ch.FETCH_TAX(RACKTARRIF.Text);
         //            TAXPER.Text = ch.TAX;
         //        }
         //        else
         //        {
         //            TAXPER.Text = "0.00";
         //        }
         //    }
         //    else if (Checksin.maxpax == 4)
         //    {
         //        RACKTARRIF.Text = d.Rows[0]["QUADRATE_TARRIF"].ToString();
         //        RACKADULT.Text = d.Rows[0]["EXTRABED_ADULT"].ToString();
         //        RACKCHILD.Text = d.Rows[0]["EXTRABED_CHILD"].ToString();
         //        CHARGETARRIF.Text = d.Rows[0]["QUADRATE_TARRIF"].ToString();
         //        if (RACKTARRIF.Text != "")
         //        {
         //            ch.FETCH_TAX(RACKTARRIF.Text);
         //            TAXPER.Text = ch.TAX;
         //        }
         //        else
         //        {
         //            TAXPER.Text = "0.00";
         //        }
         //    }
         //}
         //else
         //{
         if (Checksin.maxpax == 1)
         {
             RACKTARRIF.Text   = d.Rows[0]["SINGLERATE_TARRIF"].ToString();
             RACKADULT.Text    = d.Rows[0]["EXTRABED_ADULT"].ToString();
             RACKCHILD.Text    = d.Rows[0]["EXTRABED_CHILD"].ToString();
             CHARGETARRIF.Text = d.Rows[0]["SINGLERATE_TARRIF"].ToString();
             if (RACKTARRIF.Text != "")
             {
                 ch.FETCH_TAX(RACKTARRIF.Text);
                 TAXPER.Text = ch.TAX;
             }
             else
             {
                 TAXPER.Text = "0.00";
             }
         }
         else if (Checksin.maxpax == 2)
         {
             RACKTARRIF.Text   = d.Rows[0]["DOUBLERATE_TARRIF"].ToString();
             RACKADULT.Text    = d.Rows[0]["EXTRABED_ADULT"].ToString();
             RACKCHILD.Text    = d.Rows[0]["EXTRABED_CHILD"].ToString();
             CHARGETARRIF.Text = d.Rows[0]["DOUBLERATE_TARRIF"].ToString();
             if (RACKTARRIF.Text != "")
             {
                 ch.FETCH_TAX(RACKTARRIF.Text);
                 TAXPER.Text = ch.TAX;
             }
             else
             {
                 TAXPER.Text = "0.00";
             }
         }
         else if (Checksin.maxpax == 3)
         {
             RACKTARRIF.Text   = d.Rows[0]["TRIPLERATE_TARRIF"].ToString();
             RACKADULT.Text    = d.Rows[0]["EXTRABED_ADULT"].ToString();
             RACKCHILD.Text    = d.Rows[0]["EXTRABED_CHILD"].ToString();
             CHARGETARRIF.Text = d.Rows[0]["TRIPLERATE_TARRIF"].ToString();
             if (RACKTARRIF.Text != "")
             {
                 ch.FETCH_TAX(RACKTARRIF.Text);
                 TAXPER.Text = ch.TAX;
             }
             else
             {
                 TAXPER.Text = "0.00";
             }
         }
         else if (Checksin.maxpax == 4)
         {
             RACKTARRIF.Text   = d.Rows[0]["QUADRATE_TARRIF"].ToString();
             RACKADULT.Text    = d.Rows[0]["EXTRABED_ADULT"].ToString();
             RACKCHILD.Text    = d.Rows[0]["EXTRABED_CHILD"].ToString();
             CHARGETARRIF.Text = d.Rows[0]["QUADRATE_TARRIF"].ToString();
             if (RACKTARRIF.Text != "")
             {
                 ch.FETCH_TAX(RACKTARRIF.Text);
                 TAXPER.Text = ch.TAX;
             }
             else
             {
                 TAXPER.Text = "0.00";
             }
         }
         else if (Checksin.maxpax > 4)
         {
             RACKTARRIF.Text   = d.Rows[0]["QUADRATE_TARRIF"].ToString();
             RACKADULT.Text    = d.Rows[0]["EXTRABED_ADULT"].ToString();
             RACKCHILD.Text    = d.Rows[0]["EXTRABED_CHILD"].ToString();
             CHARGETARRIF.Text = d.Rows[0]["QUADRATE_TARRIF"].ToString();
             if (RACKTARRIF.Text != "")
             {
                 ch.FETCH_TAX(RACKTARRIF.Text);
                 TAXPER.Text = ch.TAX;
             }
             else
             {
                 TAXPER.Text = "0.00";
             }
         }
     }
     catch (Exception) { }
 }
Пример #2
0
        private void Swap_Click(object sender, RoutedEventArgs e)
        {
            //try
            //{
            if (error != 0 || (ENABLE.IsChecked == true && txtmainroom.Text == "") || (ENABLE.IsChecked == true && txttransferroom.Text == "") || (DISEBLE.IsChecked == true && txtmainroom.Text == "") || (DISEBLE.IsChecked == true && txtswap.Text == ""))
            {
                if (ENABLE.IsChecked == true)
                {
                    if (txtmainroom.Text == "")
                    {
                        txtmainroom.Text = "";
                    }
                    if (txttransferroom.Text == "")
                    {
                        txttransferroom.Text = "";
                    }
                }
                if (DISEBLE.IsChecked == true)
                {
                    if (txtmainroom.Text == "")
                    {
                        txtmainroom.Text = "";
                    }
                    if (txtswap.Text == "")
                    {
                        txtswap.Text = "";
                    }
                }
            }
            else
            {
                if (swap.Content.ToString() == "transfer")
                {
                    //new code for Room Transfer
                    ROOMCHANGE1 RM_T = new ROOMCHANGE1();
                    RM_T.MAINROOM = txtmainroom.Text;
                    DataTable dt = RM_T.GetRoomDetails();
                    if (dt.Rows.Count > 0)
                    {
                        RM_T.ROOM_CHANGE        = "Transfer";
                        RM_T.TRANSFERROOM       = txttransferroom.Text;
                        RM_T.FROM_GUESTNAME     = txtguestname.Text;
                        RM_T.FROM_GUESTSTATUS   = txtgueststatus.Text;
                        RM_T.RM_CHECKINID       = dt.Rows[0]["CHECKIN_ID"].ToString();
                        RM_T.FROM_ARRIVALDATE   = Convert.ToDateTime(txtarrivaldate.Text);
                        RM_T.FROM_DEPARTUREDATE = Convert.ToDateTime(txtdeparturedate.Text);
                        RM_T.TransferInsert();
                        RM_T.Rm_ChargedTariff = RM_T.GetTariff();
                        ch.FETCH_TAX(RM_T.Rm_ChargedTariff.ToString());
                        RM_T.Rm_GST = ch.TAX;
                        RM_T.UpdateNightAudit();
                        RM_T.UpdateAdvance();
                        RM_T.UpdatePostCharges();
                        RM_T.UpdateDiscount();
                        RM_T.UpdatecheckinDetails();
                        RM_T.UpdateMRColor();
                        RM_T.UpdateTRColor();
                    }
                    else
                    {
                        MessageBox.Show("This room is vacant");
                    }
                    //old code for Room Transfer.
                    //ROOMCHANGE1 RM = new ROOMCHANGE1();
                    //RM.MAINROOM = txtmainroom.Text;
                    //RM.ROOM_CHANGE = "transfer";
                    //RM.TRANSFERROOM = txttransferroom.Text;
                    //RM.FROM_GUESTNAME = txtguestname.Text;
                    //RM.FROM_GUESTSTATUS = txtgueststatus.Text;
                    //RM.FROM_ARRIVALDATE = Convert.ToDateTime(txtarrivaldate.Text);
                    //RM.FROM_DEPARTUREDATE = Convert.ToDateTime(txtdeparturedate.Text);
                    //RM.INSERT_BY = login.u;
                    //RM.INSERT_DATE = DateTime.Today.Date;
                    //RM.INSERT();

                    //Checksin c = new Checksin();
                    //c.ROOM_NO = txttransferroom.Text;
                    //c.FIRSTNAME = txtguestname.Text;
                    //c.ARRIVAL_DATE = Convert.ToDateTime(txtarrivaldate.Text.ToString());
                    //c.DEPARTURE_DATE = Convert.ToDateTime(txtdeparturedate.Text.ToString());
                    /////c.INSERT();
                    //RM.insertcheckin();
                    //RM.updatemainroom();
                    //RM.INSERTDATENIGHT();
                    //DataTable d = RM.count();
                    //if (DateTime.Today.Date > ROOMCHANGE1.c)
                    //{
                    //    if (d.Rows.Count == 0)
                    //    {
                    //        cunt1 = decimal.Parse("0.00");
                    //    }
                    //    else
                    //    {
                    //        cunt1 = Convert.ToDecimal(d.Rows[0]["ROOM_TARRIF"]);
                    //    }
                    //}
                    //else
                    //{
                    //    cunt1 = decimal.Parse("0.00");
                    //}
                    //RM.night();
                    //RM.night1();
                    //RM.UPDATECOLOR();
                    CLEARS();
                }
                if (swap.Content.ToString() == "swap")
                {
                    s1 = txtguestname1.Text;
                    s2 = txtgueststatus1.Text;
                    s3 = txtarrivaldate1.Text;
                    s4 = txtdeparturedate1.Text;
                    t1 = txtguestname2.Text;
                    t2 = txtgueststatus2.Text;
                    t3 = txtarrivaldate2.Text;
                    t4 = txtdeparturedate2.Text;
                    txtguestname1.Text     = t1;
                    txtgueststatus1.Text   = t2;
                    txtarrivaldate1.Text   = t3;
                    txtdeparturedate1.Text = t4;
                    txtguestname2.Text     = s1;
                    txtgueststatus2.Text   = s2;
                    txtdeparturedate2.Text = s3;
                    txtarrivaldate2.Text   = s4;

                    ROOMCHANGE1 RM = new ROOMCHANGE1();
                    RM.MAINROOM           = txtmainroom.Text;
                    RM.ROOM_CHANGE        = "swap";
                    RM.TRANSFERROOM       = txtswap.Text;
                    RM.FROM_GUESTNAME     = txtguestname.Text;
                    RM.FROM_GUESTSTATUS   = txtgueststatus.Text;
                    RM.FROM_ARRIVALDATE   = Convert.ToDateTime(txtarrivaldate.Text);
                    RM.FROM_DEPARTUREDATE = Convert.ToDateTime(txtdeparturedate.Text);
                    RM.TO_GUESTNAME       = txtguestname1.Text;
                    RM.TO_GUESTSTATUS     = txtgueststatus1.Text;
                    RM.TO_ARRIVALDATE     = Convert.ToDateTime(txtarrivaldate1.Text);
                    RM.TO_DEPARTUREDATE   = Convert.ToDateTime(txtdeparturedate1.Text);
                    RM.INSERT_BY          = login.u;
                    RM.INSERT_DATE        = DateTime.Today;

                    RM.swapinsert();
                    Checksin c = new Checksin();
                    c.ROOM_NO = txtmainroom.Text;
                    RM.Swapupdate();
                    txtguestname2.Text     = c.FIRSTNAME;
                    txtarrivaldate2.Text   = c.ARRIVAL_DATE.ToString();
                    txtdeparturedate2.Text = c.DEPARTURE_DATE.ToString();
                    txtgueststatus2.Text   = c.status;
                    c.ROOM_NO = txtswap.Text;
                    RM.Swapupdate1();
                    txtguestname1.Text     = c.FIRSTNAME;
                    txtarrivaldate1.Text   = c.ARRIVAL_DATE.ToString();
                    txtdeparturedate1.Text = c.DEPARTURE_DATE.ToString();
                    txtgueststatus1.Text   = c.status;
                    CLEARS();
                }
            }
            //}
            //catch (Exception) { }
        }
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (error != 0 || txtroomno.Text == "" || txtcontactno.Text == "")
                {
                    //pop1.IsOpen = true;
                    if (txtroomno.Text == "")
                    {
                        txtroomno.Text = "";
                    }
                    if (txtcontactno.Text == "")
                    {
                        txtcontactno.Text = "";
                    }
                }
                else
                {
                    INGUESTHOUSEINFOS IN = new INGUESTHOUSEINFOS();
                    Checksin          ch = new Checksin();
                    IN.ROOM_NO        = txtroomno.Text;
                    IN.GUEST_NAME     = txtname.Text;
                    IN.COMPANY_NAME   = txtcompanyname.Text;
                    IN.Company_Gst    = txtcompanygst.Text;
                    IN.ARRIVAL_DATE   = dt.Text;
                    IN.ARRIVAL_TIME   = txtarrivaltime.Text;
                    IN.DEPARTURE_DATE = dt1.Text;
                    IN.DEPARTURE_TIME = txtdeparturetime.Text;
                    IN.CONTACT_NO     = txtcontactno.Text;
                    IN.EMAIL          = txtemail.Text;
                    IN.ID_TYPE        = idproof.Text;
                    IN.ID_DATA        = txtproof.Text;
                    //11/15/2017 dddd
                    //IN.USER_NAME = login.u;
                    IN.INSERT_BY      = login.u;
                    IN.INSERT_DATE    = DateTime.Today;
                    IN.CHARGED_TARRIF = Math.Round(Convert.ToDecimal(txttariff.Text), 2, MidpointRounding.AwayFromZero);
                    ch.FETCH_TAX(txttariff.Text);
                    IN.TAX = Math.Round(Convert.ToDecimal(ch.TAX), 2, MidpointRounding.AwayFromZero);
                    string a1 = "Save", b1 = Convert.ToString(Save.Content);
                    if (b1 == a1)
                    {
                        IN.INSERT();
                        IN.guestupdate();
                        IN.NightAuditUpdate();
                        //MessageBox.Show("Saved sucessfully");
                        // Save.Content = "Save";
                        insert.Text = "Data Inserted.!";
                        pop2.IsOpen = true;
                    }

                    string a = "Update", b = Convert.ToString(Save.Content);
                    if (b == a)
                    {
                        IN.INSERT();
                        insert.Text = "Data Updated.!";
                        pop2.IsOpen = true;
                        //MessageBox.Show("Updated sucessfully");
                    }
                    IN.UPDTE();
                    CLEAR();
                }
            }
            catch (Exception) { }
        }
Пример #4
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) { }
        }