void cuttingentry(object sender, EventArgs e, String intlot) { String intlotcode = ""; String cutdate = ""; String supplier = ""; String tipe = ""; String species = ""; //var current = sender as Button; //this.Hide(); //var frmCutting = new frmCutting(); //frmCutting.Closed += (s, args) => this.Close(); //rcv date DateTime dt = DateTime.Now; cutdate = dt.ToString("yyyy-MM-dd HH:mm tt"); // supplier intlotcode = intlot; List <object[]> data = new List <object[]>(); MainMenu frm = new MainMenu(); data = frm.get_data_table_string("tbreceiving", "intlotcode", intlotcode); if (data.Count > 0) { tipe = data[0][3].ToString(); species = data[0][2].ToString(); supplier = data[0][5].ToString(); } if (supplier.Equals("")) { supplier = frm.get_suppliername(intlotcode); } if (species.Equals("")) { data = frm.get_data_table_string_byid_desc("tbreceiving", "", ""); if (data.Count > 0) { species = data[0][2].ToString(); } } if (tipe.Equals("")) { data = frm.get_data_table_string("tbcuttingdetails", "intlotcode", intlotcode); if (data.Count > 0) { tipe = data[0][3].ToString(); } } /* * * if (supplier.Equals("")) * { * data = frm.get_data_table_string("tbcuttingdetails", "intlotcode", intlotcode); * if (data.Count > 0) * { * tipe = data[0][3].ToString(); * supplier = frm.get_suppliername(intlotcode); * } * * data = frm.get_data_table_string_byid_desc("tbreceiving", "", ""); * if (data.Count > 0) * { * species = data[0][2].ToString(); * } * } */ this.Hide(); frmCutting fc = new frmCutting(); fc.Closed += (s, args) => this.Close(); if (data.Count > 0) { fc.setInitialValue(tipe, species, intlotcode, supplier); fc.loaddatacutdet(); fc.loaddatasummary(); fc.ShowDialog(); } }