Ejemplo n.º 1
0
 private void LOADCATEGORYlIST()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT categry_id,caegory_name FROM category", CONNECTION.CON))
         {
             DataTable DT = new DataTable();
             DA.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 DGV_CATEGORY.DataSource          = DT;
                 DGV_CATEGORY.AutoGenerateColumns = false;
             }
             else
             {
                 DGV_CATEGORY.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
 }
Ejemplo n.º 2
0
 private void LOAD_INVOICE_INFO()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT tax_status FROM reservation WHERE reservation_id=@reservation_id", CONNECTION.CON))
         {
             DA.SelectCommand.Parameters.Clear();
             DA.SelectCommand.Parameters.AddWithValue("@reservation_id", REPORT.RESERVATION_NO);
             DataTable dt = new DataTable();
             DA.Fill(dt);
             if (dt.Rows.Count > 0)
             {
                 if (dt.Rows[0].Field <string>(0) == "1")
                 {
                     lbl_status.Text = "VAT INCLUDED";
                 }
                 else
                 {
                     lbl_status.Text = "VAT NOT INCLUDED";
                 }
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), EX.Message, MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
 }
 private String CHECK_GUEST_DATA()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter da = new MySqlDataAdapter("SELECT id_no,first_name,last_name,guest_id FROM guest WHERE id_no=@id_no", CONNECTION.CON))
         {
             da.SelectCommand.Parameters.Clear();
             da.SelectCommand.Parameters.AddWithValue("@id_no", TXT_NIC_NO.Text);
             DataTable DT = new DataTable();
             da.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 return(DT.Rows[0][3].ToString());
             }
             else
             {
                 return("N");
             }
         }
     }
     catch (Exception ex)
     {
         return(ex.ToString());
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Ejemplo n.º 4
0
 private void LOAD_ROOMS()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT recerved_rooms.reservation_no , room.room_id , room.room_name , recerved_rooms.room_charge FROM recerved_rooms INNER JOIN room ON (recerved_rooms.room_id = room.room_id) WHERE recerved_rooms.reservation_no=@reservation_no", CONNECTION.CON))
         {
             DA.SelectCommand.Parameters.Clear();
             DA.SelectCommand.Parameters.AddWithValue("@reservation_no", REPORT.RESERVATION_NO);
             DataTable dt = new DataTable();
             DA.Fill(dt);
             if (dt.Rows.Count > 0)
             {
                 DGV_RESERVED_ROOM.DataSource          = dt;
                 DGV_RESERVED_ROOM.AutoGenerateColumns = false;
             }
             else
             {
                 DGV_RESERVED_ROOM.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), EX.Message, MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
 }
Ejemplo n.º 5
0
 private void LOAD_KOT()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT kot_order.order_no , resturant_table.table_no , kot_order.total_price FROM kot_order INNER JOIN resturant_table ON (kot_order.table_id = resturant_table.table_id) WHERE kot_order.reservation_no=@reservation_no", CONNECTION.CON))
         {
             DA.SelectCommand.Parameters.Clear();
             DA.SelectCommand.Parameters.AddWithValue("@reservation_no", REPORT.RESERVATION_NO);
             DataTable dt = new DataTable();
             DA.Fill(dt);
             if (dt.Rows.Count > 0)
             {
                 DGV_KOT.DataSource          = dt;
                 DGV_KOT.AutoGenerateColumns = false;
             }
             else
             {
                 DGV_KOT.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), EX.Message, MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
 }
Ejemplo n.º 6
0
        private void UPDATE_CLEAN_SERVICE()
        {
            try
            {
                CONNECTION.open_connection();

                using (MySqlCommand DA = new MySqlCommand("UPDATE room SET current_status=@current_status WHERE room_id=@room_id", CONNECTION.CON))
                {
                    DA.Parameters.Clear();
                    DA.Parameters.AddWithValue("@room_id", DGV_LIST.SelectedRows[0].Cells[1].Value.ToString());
                    DA.Parameters.AddWithValue("@current_status", "AVAILABLE");
                    DA.ExecuteNonQuery();
                }

                using (MySqlCommand DA = new MySqlCommand("UPDATE recerved_rooms SET house_keeping=@house_keeping WHERE reservation_no=@reservation_id AND room_id=@room_id", CONNECTION.CON))
                {
                    DA.Parameters.Clear();
                    DA.Parameters.AddWithValue("@reservation_id", DGV_LIST.SelectedRows[0].Cells[0].Value.ToString());
                    DA.Parameters.AddWithValue("@house_keeping", "Yes");
                    DA.Parameters.AddWithValue("@room_id", DGV_LIST.SelectedRows[0].Cells[1].Value.ToString());
                    DA.ExecuteNonQuery();
                    MSGBOX mdg = new MSGBOX(MessageAlertHeder.Success(), "SELECTED ROOM CLEAN!", MessageAlertImage.Success());
                    mdg.ShowDialog();
                }
            }
            catch (Exception EX)
            {
                MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
                mdg.ShowDialog();
            }
        }
 public static void LOAD_CATEGORY(hyflexComboBox CMB_CATEGORY)
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT categry_id,caegory_name FROM category", CONNECTION.CON))
         {
             DataTable DT = new DataTable();
             DA.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 CMB_CATEGORY.DataSource    = DT;
                 CMB_CATEGORY.DisplayMember = "caegory_name";
                 CMB_CATEGORY.ValueMember   = "categry_id";
                 CMB_CATEGORY.SelectedIndex = -1;
             }
             else
             {
                 CMB_CATEGORY.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
 }
Ejemplo n.º 8
0
 private void LOAD_FLOOR_LIST()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter adp = new MySqlDataAdapter("SELECT id,floor_no FROM floor", CONNECTION.CON))
         {
             DataTable tbl = new DataTable();
             adp.Fill(tbl);
             CMB_FLOOR.DataSource = null;
             if (tbl.Rows.Count > 0)
             {
                 CMB_FLOOR.DataSource    = tbl;
                 CMB_FLOOR.DisplayMember = "floor_no";
                 CMB_FLOOR.ValueMember   = "id";
                 CMB_FLOOR.SelectedIndex = -1;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Ejemplo n.º 9
0
 private void LOAD_PACKAGE_LIST()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT room_package_id,package_name,description,`condition`,room_package_price,package_color,CASE (package_status) WHEN '1' THEN 'ACTIVE' WHEN '0' THEN 'DEACTIVE' END AS package_status FROM room_packages", CONNECTION.CON))
         {
             DataTable DT = new DataTable();
             DA.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 DGV_PKG.DataSource          = DT;
                 DGV_PKG.AutoGenerateColumns = false;
             }
             else
             {
                 DGV_PKG.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Ejemplo n.º 10
0
 private void LOAD_ROOM_lIST()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT r.room_id,r.room_name,r.room_package_id,rp.package_name,r.room_floor,r.description,r.room_type,r.current_status FROM room  r JOIN room_packages rp ON r.room_package_id=rp.room_package_id", CONNECTION.CON))
         {
             DataTable DT = new DataTable();
             DA.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 DGV__ROOMS.DataSource          = DT;
                 DGV__ROOMS.AutoGenerateColumns = false;
             }
             else
             {
                 DGV__ROOMS.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Ejemplo n.º 11
0
 private string UPDATE_ROOM_DETAILS()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlCommand cmd = new MySqlCommand("UPDATE room SET room_name=@room_name,room_package_id=@room_package_id,room_floor=@room_floor,description=@description,room_type=@room_type WHERE room_id=@room_id", CONNECTION.CON))
         {
             cmd.Parameters.Clear();
             cmd.Parameters.AddWithValue("@room_name", TXT_ROOM_NO.Text);
             cmd.Parameters.AddWithValue("@room_package_id", CMB_ROOM_PKG.SelectedValue);
             cmd.Parameters.AddWithValue("@room_floor", CMB_FLOOR.Text);
             cmd.Parameters.AddWithValue("@description", TXT_DESCRIPTION.Text);
             cmd.Parameters.AddWithValue("@room_type", CMB_ROOM_TYPE.Text);
             cmd.Parameters.AddWithValue("@room_id", room_id);
             if (cmd.ExecuteNonQuery() > 0)
             {
                 return("done");
             }
             else
             {
                 return("error");
             }
         }
     }
     catch (Exception ex)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), ex.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
         return("error");
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Ejemplo n.º 12
0
 private void LOAD_ROOM_TYPES()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter adp = new MySqlDataAdapter("SELECT room_package_id,package_name FROM room_packages WHERE package_status='1'", CONNECTION.CON))
         {
             DataTable tbl = new DataTable();
             adp.Fill(tbl);
             CMB_ROOM_PKG.DataSource = null;
             if (tbl.Rows.Count > 0)
             {
                 CMB_ROOM_PKG.DataSource    = tbl;
                 CMB_ROOM_PKG.DisplayMember = "package_name";
                 CMB_ROOM_PKG.ValueMember   = "room_package_id";
                 CMB_ROOM_PKG.SelectedIndex = -1;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Ejemplo n.º 13
0
        private void CMB_SUPPLIER_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            if (CMB_SUPPLIER.SelectedIndex >= 0)
            {
                try
                {
                    CONNECTION.open_connection();
                    using (MySqlDataAdapter adp = new MySqlDataAdapter("SELECT IFNULL(SUM(due),0.00) FROM supplier_account WHERE supplier_id=@supplier_id", CONNECTION.CON))
                    {
                        adp.SelectCommand.Parameters.Clear();
                        adp.SelectCommand.Parameters.AddWithValue("@supplier_id", CMB_SUPPLIER.SelectedValue);
                        DataTable tbl = new DataTable();
                        adp.Fill(tbl);
                        if (tbl.Rows.Count > 0)
                        {
                            LBL_PREVIOUS_DUES.Text = tbl.Rows[0].Field <double>(0).ToString("F2");
                        }
                        else
                        {
                            LBL_PREVIOUS_DUES.Text = "0.00";
                        }
                    }
                }
                catch (Exception)
                {
                    LBL_PREVIOUS_DUES.Text = "0.00";
                }
                finally
                {
                    CONNECTION.close_connection();
                }

                LBL_TOTAL_PAYABLE.Text = (Convert.ToDouble(LBL_TOT_GRN.Text) + Convert.ToDouble(LBL_PREVIOUS_DUES.Text)).ToString("F2");
            }
        }
Ejemplo n.º 14
0
 private void LOADCATEGORYlIST_SEARCH_BY_NAME(TextBox txt_cat_name)
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT categry_id,caegory_name FROM category where caegory_name LIKE @caegory_name", CONNECTION.CON))
         {
             DA.SelectCommand.Parameters.Clear();
             DA.SelectCommand.Parameters.AddWithValue("@caegory_name", "%" + txt_category_name.Text + "%");
             DataTable DT = new DataTable();
             DA.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 DGV_CATEGORY.DataSource          = DT;
                 DGV_CATEGORY.AutoGenerateColumns = false;
             }
             else
             {
                 DGV_CATEGORY.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
 }
Ejemplo n.º 15
0
 private void LOAD_MEAP_PLAN_lIST()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT meal_type_id,`type`,description,adult_meal_price,child_meal_price,CASE (meal_plan_status) WHEN '1' THEN 'ACTIVE' WHEN '0' THEN 'DEACTIVE' END AS meal_plan_status FROM meal_types", CONNECTION.CON))
         {
             DataTable DT = new DataTable();
             DA.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 DGV_MP.DataSource          = DT;
                 DGV_MP.AutoGenerateColumns = false;
             }
             else
             {
                 DGV_MP.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Ejemplo n.º 16
0
 private string UPDATE_PACKAGE()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlCommand cmd = new MySqlCommand("UPDATE room_packages SET package_name=@package_name,description=@description,`condition`=@condition,room_package_price=@room_package_price,package_color=@package_color WHERE room_package_id=@room_package_id", CONNECTION.CON))
         {
             cmd.Parameters.Clear();
             cmd.Parameters.AddWithValue("@room_package_id", Convert.ToInt32(LBL_PKG_ID.Text));
             cmd.Parameters.AddWithValue("@package_name", TXT_PKG_NAME.Text);
             cmd.Parameters.AddWithValue("@description", TXT_DESCRIPTION.Text);
             cmd.Parameters.AddWithValue("@condition", CMB_ROOM_TYPE.Text);
             cmd.Parameters.AddWithValue("@room_package_price", Convert.ToDouble(TXT_PKG_RATE.Text));
             cmd.Parameters.AddWithValue("@package_color", LBL_COLOR.Text);
             if (cmd.ExecuteNonQuery() > 0)
             {
                 return("done");
             }
             else
             {
                 return("error");
             }
         }
     }
     catch (Exception ex)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), ex.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
         return("error");
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Ejemplo n.º 17
0
 private string UPDATE_MEAL_PLAN()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlCommand cmd = new MySqlCommand("UPDATE meal_types SET type=@type,description=@description,adult_meal_price=@adult_meal_price,child_meal_price=@child_meal_price WHERE meal_type_id=@meal_type_id", CONNECTION.CON))
         {
             cmd.Parameters.Clear();
             cmd.Parameters.AddWithValue("@meal_type_id", Convert.ToInt32(LBL_MP_ID.Text));
             cmd.Parameters.AddWithValue("@type", TXT_MP_NAME.Text);
             cmd.Parameters.AddWithValue("@description", TXT_DESCRIPTION.Text);
             cmd.Parameters.AddWithValue("@adult_meal_price", Convert.ToDouble(TXT_ADULT_PRICE.Text));
             cmd.Parameters.AddWithValue("@child_meal_price", Convert.ToDouble(TXT_CHILD_PRICE.Text));
             if (cmd.ExecuteNonQuery() > 0)
             {
                 return("done");
             }
             else
             {
                 return("error");
             }
         }
     }
     catch (Exception ex)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), ex.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
         return("error");
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
 private void LOAD_SUPPLIER_lIST()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT supplier_id, supplier_name, company_name, address, contact1, contact2, note FROM supplier ", CONNECTION.CON))
         {
             DataTable DT = new DataTable();
             DA.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 DGV_ITEM.DataSource          = DT;
                 DGV_ITEM.AutoGenerateColumns = false;
             }
             else
             {
                 DGV_ITEM.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
 }
 private void CHECK_ID_IS_AVAILABLE()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter da = new MySqlDataAdapter("SELECT guest_id, id_no, first_name, last_name, mobile_no, gender, passport_no, address, email, country_id FROM guest WHERE id_no=@id_no", CONNECTION.CON))
         {
             da.SelectCommand.Parameters.Clear();
             da.SelectCommand.Parameters.AddWithValue("@id_no", TXT_ID_NUMBER.Text);
             DataTable DT = new DataTable();
             da.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 String guest_id    = DT.Rows[0][0].ToString();
                 String id_no       = DT.Rows[0][1].ToString();
                 String first_name  = DT.Rows[0][2].ToString();
                 String last_name   = DT.Rows[0][3].ToString();
                 String mobile_no   = DT.Rows[0][4].ToString();
                 String gender      = DT.Rows[0][5].ToString();
                 String passport_no = DT.Rows[0][6].ToString();
                 MessageBox.Show("THIS GUEST ALREADY REGISTERED" + Environment.NewLine + "GUEST ID: " + guest_id + Environment.NewLine + "NIC: " + id_no + Environment.NewLine + "FIRST NAME: " + first_name + Environment.NewLine + "LAST NAME: " + last_name + Environment.NewLine + "MOBILE NO: " + mobile_no, "ALERT", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), ex.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
 }
Ejemplo n.º 20
0
 private string login()
 {
     Cursor.Current = Cursors.WaitCursor;
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter da = new MySqlDataAdapter("SELECT id,user_id,user_name,user_type,last_login_datetime FROM user_login WHERE user_name=@user_name AND PASSWORD=@password", CONNECTION.CON))
         {
             da.SelectCommand.Parameters.Clear();
             da.SelectCommand.Parameters.AddWithValue("@user_name", txt_uname.Text);
             da.SelectCommand.Parameters.AddWithValue("@password", CLS_ENCRYPTION.EncryptPlainTextToCipherText(txt_pass.Text));
             DataTable dt = new DataTable();
             da.Fill(dt);
             if (dt.Rows.Count > 0)
             {
                 return("1");
             }
             else
             {
                 return("0");
             }
         }
     }
     catch (Exception ex)
     {
         Cursor.Current = Cursors.Default;
         return(ex.Message);
     }
     finally
     {
         CONNECTION.close_connection();
         Cursor.Current = Cursors.Default;
     }
 }
 private void LOAD_GRID_VIEW()
 {
     try
     {
         double TOTAL = 0;
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT tax_type_id,tax_type,precentage FROM tax_details", CONNECTION.CON))
         {
             DataTable DT = new DataTable();
             DA.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 DGV_TAV.DataSource          = DT;
                 DGV_TAV.AutoGenerateColumns = false;
                 foreach (DataRow DR in DT.Rows)
                 {
                     TOTAL = TOTAL + DR.Field <double>(2);
                 }
                 TXT_TOTAL_TAX.Text = TOTAL.ToString("F2");
             }
             else
             {
                 DGV_TAV.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
     }
 }
 private void FILTER_ORDER_BY_ID()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter adp = new MySqlDataAdapter("SELECT ko.order_no AS order_no,CONCAT_WS(' ',g.first_name,g.last_name) AS guest_name,IFNULL(ko.reservation_no,'-') AS reservation_no,IFNULL(rm.room_name,'-') AS room_name,IFNULL(rt.table_no,'-') AS table_no,ko.total_price AS total_price,ko.special_note FROM kot_order ko LEFT JOIN guest g ON ko.guest_id=g.guest_id LEFT JOIN room rm ON ko.room_id=rm.room_id LEFT JOIN resturant_table rt ON ko.table_id=rt.table_id WHERE ko.added_date=CURDATE() AND ko.order_no LIKE @order_no AND ko.order_status<>'Canceled' ORDER BY ko.order_no", CONNECTION.CON))
         {
             adp.SelectCommand.Parameters.Clear();
             adp.SelectCommand.Parameters.AddWithValue("@order_no", "%" + TXT_ORDER_NO.Text + "%");
             DataTable tbl = new DataTable();
             adp.Fill(tbl);
             DGV_KOT.DataSource = null;
             if (tbl.Rows.Count > 0)
             {
                 DGV_KOT.AutoGenerateColumns = false;
                 DGV_KOT.DataSource          = tbl;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
 }
Ejemplo n.º 23
0
 private void LOAD_MEAL_PRICE()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT reservation_id,no_of_nights,recervation_price.total_adult_food_charges,recervation_price.total_child_food_charges FROM reservation INNER JOIN recervation_price ON (reservation.reservation_id=recervation_price.reservation_no) WHERE reservation.reservation_id=@reservation_id", CONNECTION.CON))
         {
             DA.SelectCommand.Parameters.Clear();
             DA.SelectCommand.Parameters.AddWithValue("@reservation_id", REPORT.RESERVATION_NO);
             DataTable dt = new DataTable();
             DA.Fill(dt);
             if (dt.Rows.Count > 0)
             {
                 DGV_MEAL.DataSource          = dt;
                 DGV_MEAL.AutoGenerateColumns = false;
             }
             else
             {
                 DGV_MEAL.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), EX.Message, MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
 }
 private string UPDATE_TRANSACTION_CATEGORY()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlCommand cmd = new MySqlCommand("UPDATE other_transaction_category SET trans_category_name=@trans_category_name,trans_category_type=@trans_category_type,desctiption=@desctiption WHERE id=@id", CONNECTION.CON))
         {
             cmd.Parameters.Clear();
             cmd.Parameters.AddWithValue("@trans_category_name", TXT_TRANS_CAT.Text);
             cmd.Parameters.AddWithValue("@trans_category_type", CMB_TRANS_TYPE.Text);
             cmd.Parameters.AddWithValue("@desctiption", TXT_DESCRIPTION.Text);
             cmd.Parameters.AddWithValue("@id", CATEGORY_ID);
             if (cmd.ExecuteNonQuery() > 0)
             {
                 return("done");
             }
             else
             {
                 MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), "SYSTEM ERROR. PLEASE CONTACT SYSTEM ADMIN", MessageAlertImage.Error());
                 mdg.ShowDialog();
                 return("error");
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
         return("error");
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Ejemplo n.º 25
0
 private void LOAD_MINI_BAR()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT reservation.reservation_id, SUM(purchased_mini_bar_item.price) AS price FROM purchased_mini_bar_item INNER JOIN reservation ON ( purchased_mini_bar_item.reservation_no = reservation.reservation_id ) WHERE reservation_id = @reservation_id", CONNECTION.CON))
         {
             DA.SelectCommand.Parameters.Clear();
             DA.SelectCommand.Parameters.AddWithValue("@reservation_id", REPORT.RESERVATION_NO);
             DataTable dt = new DataTable();
             DA.Fill(dt);
             if (dt.Rows.Count > 0)
             {
                 FGV_MINI_BAR.DataSource          = dt;
                 FGV_MINI_BAR.AutoGenerateColumns = false;
             }
             else
             {
                 FGV_MINI_BAR.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), EX.Message, MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
 }
 private void LOAD_OTHER_CATEGORY_LIST()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter adp = new MySqlDataAdapter("SELECT id,trans_category_name,trans_category_type,desctiption,category_status FROM other_transaction_category", CONNECTION.CON))
         {
             DataTable tbl = new DataTable();
             adp.Fill(tbl);
             DGV_TRANS_CAT.DataSource = null;
             if (tbl.Rows.Count > 0)
             {
                 DGV_TRANS_CAT.AutoGenerateColumns = false;
                 DGV_TRANS_CAT.DataSource          = tbl;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Ejemplo n.º 27
0
 private void LOAD_ADDITIONAL_SERVICE()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT additional_service.reservation_id ,room.room_name ,SUM( additional_service.additional_serivice_price) AS TOTAL FROM hyperfle_hms.additional_service INNER JOIN hyperfle_hms.additional_service_list ON (additional_service.additional_serivice_id = additional_service_list.id) INNER JOIN hyperfle_hms.room ON (additional_service.room_id = room.room_id) WHERE additional_service.reservation_id=@reservation_id GROUP BY room_name", CONNECTION.CON))
         {
             DA.SelectCommand.Parameters.Clear();
             DA.SelectCommand.Parameters.AddWithValue("@reservation_id", REPORT.RESERVATION_NO);
             DataTable dt = new DataTable();
             DA.Fill(dt);
             if (dt.Rows.Count > 0)
             {
                 DGV_ADDITIONAL_SERVICE.DataSource          = dt;
                 DGV_ADDITIONAL_SERVICE.AutoGenerateColumns = false;
             }
             else
             {
                 DGV_ADDITIONAL_SERVICE.DataSource = null;
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), EX.Message, MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
 }
Ejemplo n.º 28
0
 private void LOADGUESTS()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter adp = new MySqlDataAdapter("SELECT guest_id,CONCAT_WS(' ',first_name,last_name) AS guest_name FROM guest ORDER BY guest_id", CONNECTION.CON))
         {
             DataTable tbl = new DataTable();
             adp.Fill(tbl);
             if (tbl.Rows.Count > 0)
             {
                 CMB_GUEST.DataSource    = tbl;
                 CMB_GUEST.DisplayMember = "guest_name";
                 CMB_GUEST.ValueMember   = "guest_id";
             }
         }
     }
     catch (Exception EX)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), EX.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
 private void SAVE_NEW_AGENT()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlCommand da = new MySqlCommand("INSERT INTO agent ( agent_name) VALUES ( @agent_name)", CONNECTION.CON))
         {
             da.Parameters.Clear();
             da.Parameters.AddWithValue("@agent_name", TXT_NEW_AGENT_NAME.Text);
             if (da.ExecuteNonQuery() > 0)
             {
                 string QRY2 = "SELECT agent_id, agent_name FROM agent";
                 CLS_METHODS.FILL_COMBOBOX(CMB_AGENT, QRY2, "agent_name", "agent_id", -1);
                 CMB_AGENT.Text = TXT_NEW_AGENT_NAME.Text;
                 PNL_QUICK_ADD_AGENT.Visible = false;
             }
         }
     }
     catch (Exception ex)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), ex.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Ejemplo n.º 30
0
 private void Updatecategory()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlCommand da = new MySqlCommand("UPDATE category SET caegory_name=@caegory_name WHERE categry_id=@categry_id", CONNECTION.CON))
         {
             da.Parameters.Clear();
             da.Parameters.AddWithValue("@categry_id", lbl_category.Text);
             da.Parameters.AddWithValue("@caegory_name", txt_category_name.Text);
             if (da.ExecuteNonQuery() > 0)
             {
                 MSGBOX mdg = new MSGBOX(MessageAlertHeder.Success(), "CATEGORY UPDATED SUCCESFULLY!", MessageAlertImage.Success());
                 mdg.ShowDialog();
             }
             else
             {
                 MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "CATEGORY UPDATED SUCCESFULLY!", MessageAlertImage.Alert());
                 mdg.ShowDialog();
             }
         }
     }
     catch (Exception ex)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), ex.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }