Esempio n. 1
0
 private void LOAD_ITEMS_lIST_SEARCH_BY_NAME(System.Windows.Forms.TextBox txt_cat_name)
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT item.item_id , item.barcode , category.caegory_name , item.item_name , item.item_status, item.item_category,item_type.type,item.item_type_id FROM item INNER JOIN category ON (item.item_category = category.categry_id) INNER JOIN item_type ON (item.item_type_id=item_type.id) WHERE item.item_name LIKE @item_name ", CONNECTION.CON))
         {
             DA.SelectCommand.Parameters.Clear();
             DA.SelectCommand.Parameters.AddWithValue("@item_name", "%" + TXT_ITEMNAME.Text + "%");
             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();
     }
 }
Esempio n. 2
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();
     }
 }
Esempio n. 3
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();
     }
 }
 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();
     }
 }
Esempio n. 5
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();
     }
 }
Esempio n. 6
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();
     }
 }
Esempio n. 7
0
 private void BTN_SAVE_Click(object sender, EventArgs e)
 {
     if (TXT_MP_NAME.Text == string.Empty)
     {
         TXT_MP_NAME.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "PLEASE ENTER MEAL PLAN NAME", MessageAlertImage.Warning());
         mdg.ShowDialog();
     }
     else
     {
         if (BTN_SAVE.Text == "SAVE")
         {
             string result = SAVE_MEAL_PLAN();
             if (result == "done")
             {
                 MSGBOX mdg = new MSGBOX(MessageAlertHeder.Success(), "MEAL PLAN ADDED SUCCESSFULLY!", MessageAlertImage.Success());
                 mdg.ShowDialog();
                 DisableControls();
             }
         }
         else
         {
             string result = UPDATE_MEAL_PLAN();
             if (result == "done")
             {
                 MSGBOX mdg = new MSGBOX(MessageAlertHeder.Success(), "PACKAGE DETAILS UPDATED SUCCESSFULLY!", MessageAlertImage.Success());
                 mdg.ShowDialog();
             }
         }
         LOAD_MEAP_PLAN_lIST();
     }
 }
Esempio n. 8
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();
     }
 }
Esempio n. 9
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();
     }
 }
 private void BTN_SAVE_Click(object sender, EventArgs e)
 {
     if (DGV_ITEMS_LIST.Rows.Count == 0)
     {
         TXT_ITEMNAME.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ADD ITEMS FIRST!", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     else if (CMB_SUPPLIER.SelectedIndex == -1)
     {
         CMB_SUPPLIER.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE SELECT SUPPLIER!", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     else if (Convert.ToDouble(TXT_CARD.Text) <= 0 && TXT_CARD_NO.Text == string.Empty)
     {
         TXT_CARD_NO.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ENTER CARD NO!", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     else if (Convert.ToDouble(TXT_CHEQUE.Text) > 0 && (TXT_CHEQUE_NO.Text == string.Empty || CMB_CHEQUE_BANK.SelectedIndex == -1))
     {
         TXT_CHEQUE_NO.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ENTER CHEQUE INFORMATIONS!", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     else
     {
         SAVEGRN();
     }
 }
Esempio n. 11
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();
     }
 }
Esempio n. 12
0
 private void BTN_REMOVE_Click(object sender, EventArgs e)
 {
     CONNECTION.open_connection();
     try
     {
         foreach (DataGridViewRow dr in DGV_ADD_SERVICE.SelectedRows)
         {
             using (MySqlCommand deleteservice = new MySqlCommand("DELETE FROM additional_service WHERE id=@id", CONNECTION.CON))
             {
                 deleteservice.Parameters.AddWithValue("@id", dr.Cells[0].Value.ToString());
                 int n1 = deleteservice.ExecuteNonQuery();
                 if (n1 == 1)
                 {
                     DISPLAY_ADDED_SERVICES(Reservation_id, Room_id);
                     MSGBOX mdg = new MSGBOX(MessageAlertHeder.Success(), "Removed Successfully", MessageAlertImage.Success());
                     mdg.ShowDialog();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), ex.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Esempio n. 13
0
 private void DISPLAY_ADDED_SERVICES(string reserv_id, string room_id)
 {
     CONNECTION.open_connection();
     try
     {
         using (MySqlDataAdapter da = new MySqlDataAdapter("SELECT additional_service.id,additional_service.additional_serivice_id, additional_service_list.service_name, additional_service.additional_serivice_qty, additional_service.additional_serivice_price FROM additional_service, additional_service_list WHERE additional_service_list.id = additional_service.additional_serivice_id AND reservation_id = @rid AND additional_service.room_id = @roomid", CONNECTION.CON))
         {
             da.SelectCommand.Parameters.AddWithValue("@rid", reserv_id);
             da.SelectCommand.Parameters.AddWithValue("@roomid", Room_id);
             DataTable get_added_services = new DataTable();
             da.Fill(get_added_services);
             DGV_ADD_SERVICE.Rows.Clear();
             if (get_added_services.Rows.Count > 0)
             {
                 double total = 0;
                 foreach (DataRow dr in get_added_services.Rows)
                 {
                     DGV_ADD_SERVICE.Rows.Add(dr["id"].ToString(), dr["additional_serivice_id"].ToString(), dr["service_name"].ToString(), dr["additional_serivice_qty"].ToString(), dr["additional_serivice_price"].ToString());
                     total += Convert.ToDouble(dr["additional_serivice_price"].ToString());
                 }
                 LBL_TOTAL.Text = string.Format("{0:#,##0.00}", total);
             }
         }
     }
     catch (Exception ex)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), ex.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
Esempio n. 14
0
 private void CMB_SERVICES_SelectedIndexChanged(object sender, EventArgs e)
 {
     CONNECTION.open_connection();
     try
     {
         using (MySqlDataAdapter da = new MySqlDataAdapter("SELECT * FROM additional_service_list WHERE id=@id", CONNECTION.CON))
         {
             da.SelectCommand.Parameters.AddWithValue("@id", CMB_SERVICES.SelectedValue);
             DataTable getservices = new DataTable();
             da.Fill(getservices);
             if (getservices.Rows.Count > 0)
             {
                 double price    = ((Convert.ToDouble(getservices.Rows[0]["service_price"].ToString()) * CLS_TAX.GetTotalTaxPercentage()) / 100.0) + Convert.ToDouble(getservices.Rows[0]["service_price"].ToString());
                 double subtotal = Convert.ToDouble(TXT_QTY.Text) * price;
                 TXT_SERVICE_CHARGE.Text = string.Format("{0:#,##0.00}", price);
                 TXT_SUBTOTAL.Text       = string.Format("{0:#,##0.00}", subtotal);
             }
         }
     }
     catch (Exception ex)
     {
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), ex.Message, MessageAlertImage.Error());
         mdg.ShowDialog();
     }
     finally
     {
         CONNECTION.close_connection();
     }
 }
 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();
     }
 }
Esempio n. 16
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();
     }
 }
 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();
     }
 }
Esempio n. 18
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();
     }
 }
Esempio n. 19
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();
     }
 }
Esempio n. 20
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();
     }
 }
Esempio n. 21
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();
            }
        }
Esempio n. 22
0
        private void BTN_SAVE_Click(object sender, EventArgs e)
        {
            if (TXT_PKG_NAME.Text == string.Empty)
            {
                TXT_PKG_NAME.Focus();
                MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "PLEASE ENTER PACKAGE NAME", MessageAlertImage.Warning());
                mdg.ShowDialog();
            }
            else if (CMB_ROOM_TYPE.SelectedIndex < 0)
            {
                CMB_ROOM_TYPE.Focus();
                MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "PLEASE SELECT ROOM TYPE", MessageAlertImage.Warning());
                mdg.ShowDialog();
            }
            else
            {
                if (BTN_SAVE.Text == "SAVE")
                {
                    SAVE_ROOM_PACKAGE();
                }
                else if (BTN_SAVE.Text == "UPDATE")
                {
                    string result = UPDATE_PACKAGE();
                    if (result == "done")
                    {
                        MSGBOX mdg = new MSGBOX(MessageAlertHeder.Success(), "PACKAGE DETAILS UPDATED SUCCESSFULLY!", MessageAlertImage.Success());
                        mdg.ShowDialog();
                        LOAD_PACKAGE_LIST();
                    }
                }


                LOAD_PACKAGE_LIST();
            }
        }
Esempio n. 23
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();
     }
 }
 private void BTN_SAVE_Click(object sender, EventArgs e)
 {
     if (TXT_SUPPLIER_NAME.Text.Length == 0)
     {
         TXT_SUPPLIER_NAME.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "PLEASE ENTER SUPPLIER NAME", MessageAlertImage.Warning());
         mdg.ShowDialog();
     }
     else if (BTN_SAVE.Text == "SAVE")
     {
         SAVE_SUPPLIER();
         LOAD_SUPPLIER_lIST();
         BTN_SAVE.Text = "SAVE";
         BTN_NEW.Focus();
         clearAll();
     }
     else if (BTN_SAVE.Text == "UPDATE")
     {
         UPDATE_SUPPLIERS_DATA();
         LOAD_SUPPLIER_lIST();
         BTN_NEW.Focus();
         BTN_SAVE.Text = "SAVE";
         clearAll();
     }
 }
Esempio n. 25
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();
     }
 }
 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();
     }
 }
Esempio n. 27
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 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();
     }
 }
 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();
     }
 }
Esempio n. 30
0
 private void LOAD_ITEM_lIST()
 {
     try
     {
         CONNECTION.open_connection();
         using (MySqlDataAdapter DA = new MySqlDataAdapter("SELECT item.item_id , item.barcode , category.caegory_name , item.item_name , item.item_status, item.item_category,item_type.type,item.item_type_id FROM item INNER JOIN category ON (item.item_category = category.categry_id) INNER JOIN item_type ON (item.item_type_id=item_type.id)", 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();
     }
 }