private void rpt_customers_details_Load(object sender, EventArgs e) { try { String RES_NO = REPORT.RESERVATION_NO; ReportDocument cryRpt = new ReportDocument(); cryRpt.Load(Application.StartupPath + "\\reports\\RECEIPT.rpt"); ParameterFieldDefinitions crParameterFieldDefinitions; ParameterFieldDefinition crParameterFieldDefinition; ParameterValues crParameterValues = new ParameterValues(); ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields; crParameterDiscreteValue.Value = RES_NO; crParameterFieldDefinition = crParameterFieldDefinitions["RESERVATION_NO"]; crParameterValues = crParameterFieldDefinition.CurrentValues; crParameterValues.Clear(); crParameterValues.Add(crParameterDiscreteValue); crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); crystalReportViewer1.ReportSource = cryRpt; crystalReportViewer1.Refresh(); } 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(); } }
private async Task ImportAsync() { string res = string.Empty; loadingCircle1.Visible = true; loadingCircle1.Size = new Size(75, 75); loadingCircle1.Active = true; btn_login.Enabled = false; await Task.Run(() => { res = login(); }); loadingCircle1.Active = false; loadingCircle1.Visible = false; loadingCircle1.Size = new Size(1, 1); btn_login.Enabled = true; if (res == "1") { UPDATE_LOGIN(); DASHBOARD d = new DASHBOARD(); d.Show(); this.Hide(); } else if (res == "0") { MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), "username or password invalied!", MessageAlertImage.Error()); mdg.ShowDialog(); } else { MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), login(), MessageAlertImage.Alert()); mdg.ShowDialog(); } }
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(); } }
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(); } }
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(); } }
//private async Task lOADgRIDVIEW() //{ // loadingCircle1.Visible = true; // loadingCircle1.Size = new Size(75, 75); // loadingCircle1.Active = true; // await Task.Run(() => { // LOADCATEGORYlIST(); // }); // loadingCircle1.Active = false; // loadingCircle1.Visible = false; // loadingCircle1.Size = new Size(1, 1); //} //private async Task SAVECATEGORY() //{ // loadingCircle1.Visible = true; // loadingCircle1.Size = new Size(75, 75); // loadingCircle1.Active = true; // btn_save.Enabled = false; // await Task.Run(() => { // res = saveCategory(); // }); // loadingCircle1.Active = false; // loadingCircle1.Visible = false; // loadingCircle1.Size = new Size(1, 1); // btn_save.Enabled = true; // BTN_NEW.Focus(); // txt_category_name.Clear(); // if (res == "1") // { // lbl_category.Text = GETMAXID(); // MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "CATEGORY ADDED SUCCESFULLY!", MessageAlertImage.Warning()); // mdg.ShowDialog(); // } // else if (res == "0") // { // MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "CATEGORY ADDED FAILED!", MessageAlertImage.Warning()); // mdg.ShowDialog(); // } // else // { // MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), saveCategory(), MessageAlertImage.Alert()); // mdg.ShowDialog(); // } //} //private async Task UPDATE_CATEGORY_NAME() //{ // loadingCircle1.Visible = true; // loadingCircle1.Size = new Size(75, 75); // loadingCircle1.Active = true; // btn_save.Enabled = false; // await Task.Run(() => { // res = updatecategory(); // // LOADCATEGORYlIST(); // }); // loadingCircle1.Active = false; // loadingCircle1.Visible = false; // loadingCircle1.Size = new Size(1, 1); // btn_save.Enabled = true; // BTN_NEW.Focus(); // txt_category_name.Clear(); // lbl_category.Text = "N/A"; // btn_save.Text = "SAVE"; // if (res == "1") // { // lbl_category.Text = GETMAXID(); // MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "CATEGORY UPDATED SUCCESFULLY!", MessageAlertImage.Warning()); // mdg.ShowDialog(); // } // else if (res == "0") // { // MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "CATEGORY UPDATED FAILED!", MessageAlertImage.Warning()); // mdg.ShowDialog(); // } // else // { // MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), saveCategory(), MessageAlertImage.Alert()); // mdg.ShowDialog(); // } //} private void saveCategory() { try { CONNECTION.open_connection(); using (MySqlCommand da = new MySqlCommand("INSERT INTO category(caegory_name) VALUES(@caegory_name)", CONNECTION.CON)) { da.Parameters.Clear(); da.Parameters.AddWithValue("@caegory_name", txt_category_name.Text); if (da.ExecuteNonQuery() > 0) { lbl_category.Text = GETMAXID(); MSGBOX mdg = new MSGBOX(MessageAlertHeder.Success(), "CATEGORY ADDED SUCCESFULLY!", MessageAlertImage.Success()); mdg.ShowDialog(); } else { MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "CATEGORY ADDED FAILED!", MessageAlertImage.Alert()); mdg.ShowDialog(); } } } catch (Exception ex) { MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), ex.Message, MessageAlertImage.Error()); mdg.ShowDialog(); } finally { CONNECTION.close_connection(); } }