Exemplo n.º 1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (error != 0 || txtbillno.Text == "" || txtroom.Text == "" || txtname.Text == "" || txtttlamt.Text == "" || txtamt.Text == "")
         {
             if (txtbillno.Text == "")
             {
                 txtbillno.Text = "";
             }
             if (txtroom.Text == "")
             {
                 txtroom.Text = "";
             }
             if (txtname.Text == "")
             {
                 txtname.Text = "";
             }
             //if(txtcompany.Text == "")
             //{ txtcompany.Text = ""; }
             if (txtttlamt.Text == "")
             {
                 txtttlamt.Text = "";
             }
             //if(txttipamt.Text == "")
             //{ txttipamt.Text = ""; }
             if (txtamt.Text == "")
             {
                 txtamt.Text = "";
             }
         }
         else
         {
             Settle1 S = new Settle1();
             S.BILL_NO          = txtbillno.Text;
             S.ROOM_NO          = txtroom.Text;
             S.GUEST_NAME       = txtname.Text;
             S.REGISTRATIOIN_NO = txtreg.Text;
             S.COMPANYNAME      = txtcompany.Text;
             S.TOTAL            = txtttlamt.Text;
             S.TIP_AMOUNT       = txttipamt.Text;
             S.BALANCE_AMOUNT   = txtblamt.Text;
             S.PAYMENT_MODE     = CBPAYMENT.Text;
             S.ONLINE_PAYMENT   = CBONLINEPAYMENT.Text;
             S.CURRENCY         = CBCURRENCY.Text;
             S.AMOUNT           = txtamt.Text;
             S.TRANSFER_NO      = txttrcno.Text;
             S.CHEQUE_NO        = txtchkno.Text;
             //S.USER_NAME = login.u;
             S.INSERT_BY   = login.u;
             S.INSERT_DATE = DateTime.Today;
             S.insert();
             Checkout1.RR = int.Parse(txtroom.Text);
             c.Bill_no    = Convert.ToInt32(txtbillno.Text);
             c.Insert();
             // Send_sms();
             S.printsupdate();
             S.ColorUpdate("Blue");
             c.ADVANCEINT();
             S.update();
             c.DISCOUNTINT();
             c.POSTCHARGESINT();
             S.UP();
             S.printsBILLLUPDATE();
             S.roomstatus();
             c.CC();
             clear1();
             //String SS = await DELAY();
             //var list = new List<SqlParameter>();
             //string color = "UPDATE ROOMMASTER SET BACKGROUND_COLOR = @BGCOLOR WHERE ROOM_NO=@ROOMNO";
             //list.AddSqlParameter("@BGCOLOR", "Green");
             //list.AddSqlParameter("@ROOMNO", S.ROOM_NO);
             //DbFunctions.ExecuteCommand<DataTable>(color, list);
             hm.truncate();
             MessageBox.Show("Updated Successfully");
             NavigationService.Navigate(new Uri("View/Operations/Checkout.xaml", UriKind.RelativeOrAbsolute));
             //NavigationService nav = NavigationService.GetNavigationService(this);
             //nav.Refresh();
         }
     }
     catch (Exception) { }
 }