bool CheckNull() { if (cmb_dept.Text == "") { infomesge mes = new infomesge(); mes.WarningMesger("Data " + lbl_dept.Text + " is null", "Warning System !!!", this); return(false); } if (cmb_productioncode.Text == "") { infomesge mes = new infomesge(); mes.WarningMesger("Data " + lbl_productioncode.Text + " is null !!!", "Warning System", this); return(false); } if (txt_tagetoutput.Text == "") { infomesge mes = new infomesge(); mes.WarningMesger("Data " + lbl_tagetoutput.Text + " is null !!!", "Warning System", this); return(false); } if (txt_tagetNG.Text == "") { infomesge mes = new infomesge(); mes.WarningMesger("Data " + lbl_tagetng.Text + " is null !!!", "Warning System", this); return(false); } if (cmb_type.Text == "") { infomesge mes = new infomesge(); mes.WarningMesger("Data " + lbl_Type.Text + " is null !!!", "Warning System", this); return(false); } return(true); }
private void btn_add_Click(object sender, EventArgs e) { if (cmb_modelcode.Text == "" || tv_line.Nodes[0].Nodes.Count < 1) { return; } string sqldelete = "delete from m_model_line where modelcode = '" + cmb_modelcode.Text + "'"; sqlCON connect = new sqlCON(); connect.sqlExecuteNonQuery(sqldelete, false); //false không xuất hiện thông báo for (int i = 0; i < tv_line.Nodes[0].Nodes.Count; i++) { //if (tv_line.Nodes[0].Nodes[i].Checked) //{ // MessageBox.Show(tv_line.Nodes[0].Nodes[i].Text); //} string sqladd = @"insert into m_model_line(modelcode, linecode, status, datetimeRST) values ('" + cmb_modelcode.Text + "','" + tv_line.Nodes[0].Nodes[i].Text + "','" + tv_line.Nodes[0].Nodes[i].Checked.ToString() + "',GETDATE())"; connect.sqlExecuteNonQuery(sqladd, false); } infomesge infor = new infomesge(); infor.WarningMesger("Update is Ok", "INFO", this); getdgvfull(cmb_modelcode.Text); }
bool checkdata() { if (cmb_TC001.Text == "" || cmb_TC002.Text == "" || cmb_TA001.Text == "" || cmb_TA002.Text == "") { infomesge mes = new infomesge(); mes.WarningMesger("Data is null", "Warning System", this); return(false); } return(true); }
bool checkdata() { if (txt_pass.Text == "" || txt_pass_confirm.Text == "") { infomesge mes = new infomesge(); mes.WarningMesger("Data is null", "Warning System", this); return(false); } if (txt_pass.Text != txt_pass_confirm.Text) { infomesge mes = new infomesge(); mes.ErrorMesger("Password confirm is not correct", "Warning System", this); return(false); } return(true); }
private void btn_delete_Click(object sender, EventArgs e) { if (keyid == "") { return; } string sqldelete = @"delete from t_ERP_planning where id = '" + keyid + "'"; sqlCON connectdelete = new sqlCON(); connectdelete.sqlExecuteNonQuery(sqldelete, true); infomesge info = new infomesge(); info.WarningMesger("One Row is deleted !!!", "Deleted OK", this); cmb_productioncode.Text = ""; btn_search_Click(sender, e); }
bool checkdata() { if (txt_deptcode.Text == "" || txt_deptname.Text == "") { infomesge mes = new infomesge(); mes.WarningMesger("Data is null", "Warning System", this); return(false); } sqlCON connect = new sqlCON(); if (int.Parse(connect.sqlExecuteScalarString("select count(*) from m_dept where deptcode ='" + txt_deptcode.Text + "'")) > 0 && addupdate == 1) { infomesge mes = new infomesge(); mes.ErrorMesger("UserCode is duplicate", "Error System", this); return(false); } return(true); }
bool checkdata() { if (cmb_deptcode.Text == "" || txt_emailaddress.Text == "" || cmb_usingfunction.Text == "" || cmb_defaultstatus.Text == "") { infomesge mes = new infomesge(); mes.WarningMesger("Data is null", "Warning System", this); return(false); } sqlCON connect = new sqlCON(); if (int.Parse(connect.sqlExecuteScalarString("select count(*) from m_email where emailaddress ='" + txt_emailaddress.Text + "' and usingfunction ='" + cmb_usingfunction.Text + "'")) > 0 && addupdate == 1) { infomesge mes = new infomesge(); mes.ErrorMesger("UserCode is duplicate", "Error System", this); return(false); } return(true); }
bool checkdata() { if (cmb_process.Text == "" || cmb_line.Text == "" || cmb_factory.Text == "" || cmb_ip.Text == "") { infomesge mes = new infomesge(); mes.WarningMesger("Data is null", "Warning System", this); return(false); } sqlCON connect = new sqlCON(); if (int.Parse(connect.sqlExecuteScalarString("select count(*) from m_ipPLC where IPPLC ='" + cmb_ip.Text + "'")) > 0 && addupdate == 1) { infomesge mes = new infomesge(); mes.ErrorMesger("UserCode is duplicate", "Error System", this); return(false); } return(true); }
bool keycheck() { StringBuilder sqlcheck = new StringBuilder(); if (cmb_type.Text == "Daily") { sqlcheck.Append("select count(*) from t_ERP_planning where 1=1"); sqlcheck.Append(" and deptcode = '" + cmb_dept.Text + "'"); sqlcheck.Append(" and datetime_planning = '" + dtp_dateplaning.Text + "'"); sqlcheck.Append(" and type = '" + cmb_type.Text + "'"); sqlcheck.Append(" and production_code = '" + cmb_productioncode.Text + "'"); sqlCON connectsql = new sqlCON(); if (int.Parse(connectsql.sqlExecuteScalarString(sqlcheck.ToString())) == 0) { return(false); } } if (cmb_type.Text == "Monthly") { string month = DateTime.Now.ToString("MM"); sqlcheck.Append(" select max(datetime_planning) from t_ERP_planning where 1 = 1"); sqlcheck.Append(" and deptcode = '" + cmb_dept.Text + "'"); sqlcheck.Append(" and type = '" + cmb_type.Text + "'"); sqlcheck.Append(" and production_code = '" + cmb_productioncode.Text + "'"); sqlCON connectsql = new sqlCON(); string a = connectsql.sqlExecuteScalarString(sqlcheck.ToString()); if (connectsql.sqlExecuteScalarString(sqlcheck.ToString()) == "") { return(false); } if (connectsql.sqlExecuteScalarString(sqlcheck.ToString()).Substring(5, 2) != month) { return(false); } } infomesge info = new infomesge(); info.ErrorMesger("Data is dulicate !!!", "Error Messenger", this); return(true); }
void checkdulucate(bool check) { dt = new DataTable(); StringBuilder sql = new StringBuilder(); sql.Append("select * from t_OCTA where 1=1 "); sql.Append(" and TA01 = '" + cmb_TA001.Text + "'"); sql.Append(" and TA02 = '" + cmb_TA002.Text + "'"); sql.Append(" and TA03 = '" + cmb_TC001.Text + "'"); sql.Append(" and TA04 = '" + cmb_TC002.Text + "'"); sql.Append("order by TAID"); sqlCON conect = new sqlCON(); conect.sqlDataAdapterFillDatatable(sql.ToString(), ref dt); dgv_connectdata.DataSource = dt; if (dgv_connectdata.RowCount > 0 && check == true) //checktruoc { infomesge mes = new infomesge(); mes.ErrorMesger("UserCode is duplicate", "Infomation System", this); } }
private void btn_update_Click(object sender, EventArgs e) { if (cmb_permission.Text == "" || dgv_permission.Rows.Count < 1) { return; } string sqldelete = "delete from m_permission where permission = '" + cmb_permission.Text + "' and permission not like 'admin'"; sqlCON connect = new sqlCON(); connect.sqlExecuteNonQuery(sqldelete, false); //false không xuất hiện thông báo for (int i = 0; i < dgv_permission.Rows.Count; i++) { string sqladd = @"insert into m_permission(permission, button, status, datetimeRST) values ('" + cmb_permission.Text + "','" + dgv_permission.Rows[i].Cells[0].Value.ToString() + "','" + dgv_permission.Rows[i].Cells[1].Value.ToString() + "',GETDATE())"; connect.sqlExecuteNonQuery(sqladd, false); } infomesge infor = new infomesge(); infor.WarningMesger("Update is Ok", "INFO", this); getdgvfull(cmb_permission.Text); }