private void frmCreateNewLoin_Load(object sender, EventArgs e) { txtbatch.Focus(); seticon_forbutton(); List <object[]> dtlot = new List <object[]>(); MainMenu flot = new MainMenu(); dtlot = flot.get_data_table_string("tbsetup", "category", "certificate"); if (dtlot.Count > 0) { for (int i = 0; i < dtlot.Count; i++) { cbcertificate.Items.Add(dtlot[i][1]); } cbcertificate.Items.Add(" "); } dtlot = flot.get_data_table_string("tbgrade", "module", "retouching"); if (dtlot.Count > 0) { for (int i = 0; i < dtlot.Count; i++) { cbgrade.Items.Add(dtlot[i][1]); } } dtlot = flot.get_data_table_string("tbsetup", "category", "typefish"); if (dtlot.Count > 0) { for (int i = 0; i < dtlot.Count; i++) { cbfishtype.Items.Add(dtlot[i][1]); } } dateTimePicker1.Value = DateTime.Now; dateTimePicker2.Value = DateTime.Now; }
private void generateqrlabel() { QrCodeEncodingOptions options = new QrCodeEncodingOptions { DisableECI = true, CharacterSet = "UTF-8", Width = 100, Height = 100, }; BarcodeWriter writer = new BarcodeWriter(); writer.Format = BarcodeFormat.QR_CODE; writer.Options = options; var qr = new ZXing.BarcodeWriter(); qr.Options = options; qr.Format = ZXing.BarcodeFormat.QR_CODE; string intlotcode = get_intlotcode(); String asfis = ""; String suppliercode = txtsuppcode.Text.Trim(); List <object[]> data = new List <object[]>(); MainMenu frm = new MainMenu(); data = frm.get_data_table_string("tbspecies", "", ""); if (data.Count > 0) { asfis = data[0][1].ToString(); } String origin = "INDONESIA"; String fishing_ground = get_fishing_ground(); String certcode = cbcertificate.Text.Trim(); String loincode = loin_code_global; String grade = cbgrade.Text.Trim(); double rweight = Double.Parse(txtweight.Text); String remark = txtremark.Text.Trim(); String qrtext = loincode + "\r\nAsfis: " + asfis + "\r\ngrade: " + grade + "\r\nweight: " + rweight.ToString() + "Kg\r\n" + origin + "\r\nfishing_ground: " + fishing_ground + "\r\n" + intlotcode + "\r\n" + remark + "\r\n"; var result = new Bitmap(qr.Write(qrtext)); pbLabel.Image = result; printlabel(); }
private void cbproductname_SelectedIndexChanged(object sender, EventArgs e) { List <object[]> dtlot = new List <object[]>(); MainMenu flot = new MainMenu(); dtlot = flot.get_data_table_string("tbproductsetup", "productname", cbproductname.Text.Trim()); if (dtlot.Count > 0) { for (int i = 0; i < dtlot.Count; i++) { cbproductpacking.Items.Add(dtlot[i][3]); } } }
private void txtsuppcode_KeyPress(object sender, KeyPressEventArgs e) { List <object[]> dtlot = new List <object[]>(); MainMenu flot = new MainMenu(); dtlot = flot.get_data_table_string("tbsupplier", "suppcode", txtsuppcode.Text); if (dtlot.Count > 0) { for (int i = 0; i < dtlot.Count; i++) { lblsuppname.Text = dtlot[i][15].ToString(); } } }
private String get_useraccess() { String useraccess = ""; String userlogin = Properties.Settings.Default.username; MainMenu frm = new MainMenu(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbuser", "username", userlogin.Trim()); if (data.Count > 0) { useraccess = data[0][9].ToString(); } return(useraccess); }
public void set_supplier_integration(String global_suppcode, object sender, EventArgs e) { List <object[]> data = new List <object[]>(); MainMenu frm = new MainMenu(); data = frm.get_data_table_string("tbsupplier", "registration_code", global_suppcode); if (data.Count > 0) { isintegration = true; String suppliercode = data[0][2].ToString(); comboBox1.Text = suppliercode; comboBox1_SelectedIndexChanged(sender, e); } }
private void save_customer() { MainMenu frm = new MainMenu(); //get data from table List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbcustomer", "custcode", txtcustcode.Text); String status = "Not Ada"; if (data.Count > 0) { status = "Ada"; //id=int.Parse(data[0][0].ToString()); } String connString = Konek(); MySqlConnection conn5 = new MySqlConnection(connString); conn5.Open(); try { MySqlCommand mySql3 = conn5.CreateCommand(); if (status.Equals("Not Ada")) { mySql3.CommandText = "Insert into tbcustomer(custcode,custname,address,phone,contact,state,country,certificate)" + " values(@custcode,@custname,@address,@phone,@contact,@state,@country,@certificate)"; } else { mySql3.CommandText = "Update tbcustomer Set custname=@custname,address=@address,phone=@phone,contact=@contact,state=@state,country=@country,certificate=@certificate where custcode=@custcode"; } mySql3.Parameters.AddWithValue("@custcode", txtcustcode.Text); mySql3.Parameters.AddWithValue("@custname", txtcustname.Text); mySql3.Parameters.AddWithValue("@address", txtaddress.Text); mySql3.Parameters.AddWithValue("@phone", txtphone.Text); mySql3.Parameters.AddWithValue("@contact", txtcontactperson.Text); mySql3.Parameters.AddWithValue("@state", txtstate.Text); mySql3.Parameters.AddWithValue("@country", cbcountry.Text); mySql3.Parameters.AddWithValue("@certificate", txtcertificate.Text); mySql3.ExecuteNonQuery(); MessageBox.Show("Data " + txtcustcode.Text + " stored"); } catch (Exception ex) { MessageBox.Show("Error message " + ex.Message); } conn5.Close(); }
private void save_species() { MainMenu frm = new MainMenu(); //get data from table List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbspecies", "speciesname", txtspeciesname.Text); String status = "Not Ada"; if (data.Count > 0) { status = "Ada"; } String connString = Konek(); MySqlConnection conn5 = new MySqlConnection(connString); conn5.Open(); try { MySqlCommand mySql3 = conn5.CreateCommand(); if (status.Equals("Not Ada")) { mySql3.CommandText = "Insert into tbspecies(speciescode, speciesname, scientificname)" + " values(@speciescode, @speciesname, @scientificname)"; } else { mySql3.CommandText = "Update tbspecies Set speciesname=@speciesname,scientificname=@scientificname, speciescode=@speciescode where id=@id"; } mySql3.Parameters.AddWithValue("@speciescode", txtasfiscode.Text); mySql3.Parameters.AddWithValue("@speciesname", txtspeciesname.Text); mySql3.Parameters.AddWithValue("@scientificname", txtscientificname.Text); if (status.Equals("Ada")) { mySql3.Parameters.AddWithValue("@id", idspecies); } mySql3.ExecuteNonQuery(); MessageBox.Show("Data " + txtscientificname.Text + " has been stored "); } catch (Exception ex) { MessageBox.Show("Error message " + ex.Message); } conn5.Close(); }
private void load_country() { MainMenu frm = new MainMenu(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tb_countries", "", ""); if (data.Count > 0) { cbcountry.Items.Clear(); for (int i = 0; i < data.Count; i++) { cbcountry.Items.Add(data[i][2].ToString()); } } }
private void load_grupsize_list() { cbsize.Items.Clear(); MainMenu frm = new MainMenu(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbpackingsize", "", ""); if (data.Count > 0) { for (int i = 0; i < data.Count; i++) { cbsize.Items.Add(data[i][1].ToString()); } } }
public void setoptionpo() { MainMenu frm = new MainMenu(); //get data from table List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbpo", "status", "open"); if (data.Count > 0) { cbpo.Items.Clear(); for (int i = 0; i < data.Count; i++) { cbpo.Items.Add(data[i][1].ToString()); } } }
private void setoptionshipterms() { MainMenu frm = new MainMenu(); //get data from table List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbincoterms", "", ""); if (data.Count > 0) { cbshipterms.Items.Clear(); for (int i = 0; i < data.Count; i++) { cbshipterms.Items.Add(data[0][1].ToString()); } } }
private void load_fishing_ground() { MainMenu frm = new MainMenu(); cbfishing_ground.Items.Clear(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbsetup", "category", "Fishing Area"); if (data.Count > 0) { //to put value in combobox for (int i = 0; i < data.Count; i++) { cbfishing_ground.Items.Add(data[i][1]); } } }
private void save_payterms() { MainMenu frm = new MainMenu(); //get data from table List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbpayterms", "payterms", txtpayterms.Text); String status = "Not Ada"; if (data.Count > 0) { status = "Ada"; //id=int.Parse(data[0][0].ToString()); } String connString = Konek(); MySqlConnection conn5 = new MySqlConnection(connString); conn5.Open(); try { MySqlCommand mySql3 = conn5.CreateCommand(); if (status.Equals("Not Ada")) { mySql3.CommandText = "Insert into tbpayterms(payterms,paydescription,dueday)" + " values(@payterms,@paydescription,@dueday)"; } else { mySql3.CommandText = "Update tbpayterms Set paydescription=@paydescription,dueday=@dueday where payterms=@payterms"; } mySql3.Parameters.AddWithValue("@payterms", txtpayterms.Text); mySql3.Parameters.AddWithValue("@paydescription", txtdescription1.Text); mySql3.Parameters.AddWithValue("@dueday", Int32.Parse(txtdueday.Text)); mySql3.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show("Error message " + ex.Message); } conn5.Close(); MessageBox.Show("Data " + txtpayterms.Text + " stored"); }
private void loaddatacompany() { List <object[]> datacompany; MainMenu frm = new MainMenu(); datacompany = frm.get_data_table_string("view_company", "", ""); txtcompany.Text = datacompany[0][1].ToString(); txtcompanyname.Text = datacompany[0][2].ToString(); txtowner.Text = datacompany[0][3].ToString(); txtaddress.Text = datacompany[0][7].ToString(); txtphone.Text = datacompany[0][8].ToString(); cbProvinsi.Text = datacompany[0][16].ToString(); cbKabupaten.Text = datacompany[0][17].ToString(); cbKecamatan.Text = datacompany[0][18].ToString(); txtlicenseid.Text = datacompany[0][5].ToString(); txtcode.Text = datacompany[0][13].ToString(); txtcompanyregistration.Text = datacompany[0][15].ToString(); if (datacompany[0][4].ToString().Equals("M")) { rbmale.Checked = true; rbfemale.Checked = false; } else if (datacompany[0][4].ToString().Equals("F")) { rbfemale.Checked = true; rbmale.Checked = false; } dateTimePicker1.Value = DateTime.Parse(datacompany[0][6].ToString()); txtcompany.Enabled = false; txtcompanyname.Enabled = false; txtowner.Enabled = false; txtaddress.Enabled = false; txtphone.Enabled = false; cbProvinsi.Enabled = false; cbKabupaten.Enabled = false; cbKecamatan.Enabled = false; txtlicenseid.Enabled = false; rbfemale.Enabled = false; rbmale.Enabled = false; dateTimePicker1.Enabled = false; txtcode.Enabled = false; txtcompanyregistration.Enabled = false; }
private void txtbatch_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToInt32(e.KeyChar) == 13) { List <object[]> dtlot = new List <object[]>(); MainMenu flot = new MainMenu(); dtlot = flot.get_data_table_string("tbsupplier", "batchcode", txtbatch.Text.Trim()); if (dtlot.Count == 0) { MessageBox.Show("No batch code " + txtbatch.Text.Trim() + " found in Supplier Setup"); txtbatch.Focus(); } else { txtsuppcode.Focus(); } } }
private void load_fishing_gear() { MainMenu frm = new MainMenu(); //get data from table List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbsetup", "category", "fishinggear"); Int32 i = 0; if (data.Count > 0) { cbFishingGear.Items.Clear(); for (i = 0; i < data.Count; i++) { cbFishingGear.Items.Add(data[i][1]); } } }
private void load_sequence_receiving_setup() { MainMenu frm = new MainMenu(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbsetup", "category", "receivingsequencenumber"); if (data.Count > 0) { if (data[0][3].ToString().Equals("Y")) { cbsequencenumber.Checked = true; } else { cbsequencenumber.Checked = false; } } }
private void load_offline_integration_setup() { MainMenu frm = new MainMenu(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbsetup", "category", "integrationsupplierapps"); if (data.Count > 0) { if (data[0][3].ToString().Equals("Y")) { cbIntegrationSupplierApps.Checked = true; } else { cbIntegrationSupplierApps.Checked = false; } } }
private void loadtipe_grid() { MainMenu frm = new MainMenu(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tboptionproductsetup", "kategori", "tipe"); if (data.Count > 0) { dataGridView2.Rows.Clear(); dataGridView2.Rows.Add(data.Count); for (int i = 0; i < data.Count; i++) { dataGridView2.Rows[i].Height = 40; dataGridView2.Rows[i].Cells[0].Value = (i + 1).ToString(); dataGridView2.Rows[i].Cells[1].Value = data[i][1].ToString(); } } }
private void dgProductCodeSAP_CellClick(object sender, DataGridViewCellEventArgs e) { if (dgProductCodeSAP.Rows[e.RowIndex].Cells[1].Value == null) { return; } if (e.ColumnIndex == dgProductCodeSAP.Columns["Delete"].Index && e.RowIndex >= 0) { DialogResult dialogResult = MessageBox.Show("Are you sure to delete " + this.dgProductCodeSAP.Rows[e.RowIndex].Cells[5].Value + "?", "Delete", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { Int32 n = e.RowIndex; Int32 id = 0; MainMenu frm = new MainMenu(); frm.delete_table("tbproductsetup_sapcode", "itemcodesap", this.dgProductCodeSAP.Rows[e.RowIndex].Cells[5].Value.ToString()); loaddataproductgrid(); } } if (e.ColumnIndex == dgProductCodeSAP.Columns["Edit"].Index && e.RowIndex >= 0 && dgProductCodeSAP.Rows.Count > 0) { DialogResult dialogResult = MessageBox.Show("Are you sure to Edit Code " + this.dgProductCodeSAP.Rows[e.RowIndex].Cells[5].Value + " ?", "Edit", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { Int32 n = e.RowIndex; Int32 id = 0; MainMenu frm = new MainMenu(); String itemcode = this.dgProductCodeSAP.Rows[e.RowIndex].Cells[5].Value.ToString(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbproductsetup_sapcode", "itemcodesap", itemcode); if (data.Count > 0) { cbproduct.Text = data[0][1].ToString(); cbgrade.Text = data[0][2].ToString(); cbsize.Text = data[0][3].ToString(); cbcertificate.Text = data[0][4].ToString(); txtSAPItemCode.Text = data[0][5].ToString(); } } } }
private void set_fishing_ground_supplier() { String fishingground = ""; MainMenu frm = new MainMenu(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbsupplier", "suppcode", this.suppcode.Text); if (data.Count > 0) { fishingground = data[0][7].ToString(); } if (!fishingground.Contains(cbfishing_ground.Text)) { if (fishingground.Length == 0) { fishingground = cbfishing_ground.Text; } else { fishingground = fishingground + "," + cbfishing_ground.Text; } } String connString = Konek(); MySqlConnection conn5 = new MySqlConnection(connString); conn5.Open(); try { MySqlCommand mySql3 = conn5.CreateCommand(); mySql3.CommandText = "update tbsupplier set fishingground=@fishingground where suppcode=@suppcode"; mySql3.Parameters.AddWithValue("@fishingground", fishingground); mySql3.Parameters.AddWithValue("@suppcode", this.suppcode.Text); mySql3.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show("Error message " + ex.Message); } conn5.Close(); }
private void load_data_fishing_gear() { MainMenu frm = new MainMenu(); //get data from table List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbsetup", "category", "fishinggear"); Int32 i = 0; if (data.Count > 0) { dataGridView2.Rows.Clear(); dataGridView2.Rows.Add(data.Count); for (i = 0; i < data.Count; i++) { dataGridView2.Rows[i].Cells[0].Value = (i + 1).ToString(); dataGridView2.Rows[i].Cells[1].Value = data[i][1].ToString(); } } }
public String generatePL() { String seq = get_number_sequence_packinglist(); String company = ""; String plno = ""; MainMenu frm = new MainMenu(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbcompany", "", ""); if (data.Count > 0) { company = data[0][1].ToString().Trim(); } DateTime dt = DateTime.Now; // Or whatever string formatdate = dt.ToString("yyyy/MM"); plno = company + "-" + formatdate + "/" + seq; return(plno); }
private void txtasfiscode_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToInt32(e.KeyChar) == 13) { MainMenu frm = new MainMenu(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbasfis", "asfis_code", txtasfiscode.Text.Trim()); if (data.Count > 0) { txtspeciesname.Text = data[0][2].ToString(); txtscientificname.Text = data[0][1].ToString(); } else { MessageBox.Show("Code " + txtasfiscode.Text + " has not found, please try another code"); txtasfiscode.Focus(); } button2.Focus(); } }
private void dgprocessingcompany_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (dgprocessingcompany.Rows[e.RowIndex].Cells[1].Value == null) { return; } if (e.ColumnIndex == dgprocessingcompany.Columns["Delete"].Index && e.RowIndex >= 0) { DialogResult dialogResult = MessageBox.Show("Are you sure to delete " + this.dgprocessingcompany.Rows[e.RowIndex].Cells[1].Value + "?", "Delete", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { String cocode = this.dgprocessingcompany.Rows[e.RowIndex].Cells[1].Value.ToString(); MainMenu frm = new MainMenu(); frm.delete_table("tbprocessingcompany", "co_code", cocode); dgprocessingcompany.Rows.RemoveAt(dgprocessingcompany.SelectedRows[0].Index); loaddataprocessingcompany(); } } if (e.ColumnIndex == dgprocessingcompany.Columns["Edit"].Index && e.RowIndex >= 0) { DialogResult dialogResult = MessageBox.Show("Are you sure to Edit " + this.dgprocessingcompany.Rows[e.RowIndex].Cells[1].Value + "?", "Delete", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { MainMenu frm = new MainMenu(); String cocode = this.dgprocessingcompany.Rows[e.RowIndex].Cells[1].Value.ToString(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbprocessingcompany", "co_code", cocode); if (data.Count > 0) { txtcocode.Text = cocode; txtcompanyname.Text = data[0][1].ToString(); txtaddress.Text = data[0][2].ToString(); txtphone.Text = data[0][3].ToString(); } } } }
private void loaddatapo() { dataGridView1.Rows.Clear(); List <object[]> data = new List <object[]>(); MainMenu frm = new MainMenu(); data = frm.get_data_table_string("tbpo", "", ""); if (data.Count > 0) { dataGridView1.Rows.Add(data.Count); for (int i = 0; i < data.Count; i++) { dataGridView1.Rows[i].Height = 50; dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString(); dataGridView1.Rows[i].Cells[1].Value = data[i][1].ToString(); dataGridView1.Rows[i].Cells[2].Value = data[i][2].ToString(); dataGridView1.Rows[i].Cells[3].Value = data[i][3].ToString(); } Delete_columnbutton(); } }
private void loaddataproduksetup() { List <object[]> datacompany; MainMenu frm = new MainMenu(); datacompany = frm.get_data_table_string("tbproductsetup", "", ""); if (datacompany.Count > 0) { cbstate.Text = datacompany[0][0].ToString(); cbtipe.Text = datacompany[0][1].ToString(); cbtradeunit.Text = datacompany[0][2].ToString(); cbspecies.Text = datacompany[0][3].ToString(); txtproduct.Text = get_scientific(cbspecies.Text.Trim()); txtproduct.Enabled = false; } cbstate.Enabled = false; cbtipe.Enabled = false; cbtradeunit.Enabled = false; cbspecies.Enabled = false; txtproduct.Enabled = false; }
private void btnaccess_Click(object sender, EventArgs e) { if (txtuserid.Text.Equals("")) { MessageBox.Show("You cannot display access user, please click edit button in specified user"); } else { grpaccess.Visible = true; String useraccess = ""; List <object[]> data = new List <object[]>(); MainMenu frm = new MainMenu(); data = frm.get_data_table_string("tbuser", "username", txtuserid.Text.Trim()); if (data.Count > 0) { useraccess = data[0][9].ToString(); } load_access_user(useraccess); } }
private void label1_Click(object sender, EventArgs e) { groupASFIS.Visible = true; MainMenu frm = new MainMenu(); List <object[]> data = new List <object[]>(); data = frm.get_data_table_string("tbasfis", "", ""); if (data.Count > 0) { dataGridView1.Rows.Clear(); dataGridView1.Rows.Add(data.Count); int a = data.Count; int i = 0; while (i < a) { dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString(); dataGridView1.Rows[i].Cells[1].Value = data[i][0].ToString(); if (data[i][1].Equals(null)) { dataGridView1.Rows[i].Cells[2].Value = ""; } else { dataGridView1.Rows[i].Cells[2].Value = data[i][1].ToString(); } if (data[i][2].Equals(null)) { dataGridView1.Rows[i].Cells[3].Value = ""; } else { dataGridView1.Rows[i].Cells[3].Value = data[i][2].ToString(); } i = i + 1; } } }