private bool Click_Save() { objIni.SetKeyFieldValue("SQL", "initial catalog", "InodeMFG"); if (cmbTheme.SelectedValue != null && cmbTheme.SelectedValue.ToString() == "") { AutoClosingMessageBox.Show("Please Enter Theme Name", "Validation", 3000); return(false); } if (objBASEFILEDS.Tran_mode != "view_mode" && txtEid.Text != "") { Regex emailPattern = new Regex(@"^[a-zA-Z][\w\.-]{2,28}[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"); if (!emailPattern.IsMatch(txtEid.Text)) { AutoClosingMessageBox.Show("Please provide valid E-mail ID", "Validation", 3000); return(false); } } if (objBASEFILEDS.Tran_mode != "view_mode" && txtUser.Text != "") { Regex mobilePattern = new Regex(@"[a-zA-Z]+$"); if (!mobilePattern.IsMatch(txtUser.Text)) { AutoClosingMessageBox.Show("Please enter Alphabets", "Validation", 3000); return(false); } } if (objBASEFILEDS.Tran_mode != "view_mode" && txtConct.Text != "") { Regex contactpattern = new Regex(@"^(?:[0-9]+(?:-[0-9])?)*$"); if (!contactpattern.IsMatch(txtConct.Text)) { AutoClosingMessageBox.Show("Please enter valid number", "Validation", 3000); return(false); } } if (objBASEFILEDS.Tran_mode != "view_mode" && txtMob.Text != "") { Regex mobilePattern = new Regex(@"[-+]?[0-9]?[0-9]?\d{10}$"); if (!mobilePattern.IsMatch(txtMob.Text)) { AutoClosingMessageBox.Show("Please enter a valid Mobile number", "Validation", 3000); return(false); } } if (txtUser.Text != "") { if (txtPwd.Text != "" && txtRpwd.Text != "") { if (txtPwd.Text == txtRpwd.Text) { objBASEFILEDS.HTMAIN["userid"] = objBASEFILEDS.Tran_id; objBASEFILEDS.HTMAIN["user_nm"] = txtUser.Text; objBASEFILEDS.HTMAIN["pwd"] = txtPwd.Text; objBASEFILEDS.HTMAIN["r_pwd"] = txtRpwd.Text; objBASEFILEDS.HTMAIN["status_nm"] = cmbStat.Text; objBASEFILEDS.HTMAIN["email"] = txtEid.Text; objBASEFILEDS.HTMAIN["designation"] = txtDesgn.Text; objBASEFILEDS.HTMAIN["mobile"] = txtMob.Text; objBASEFILEDS.HTMAIN["phone"] = txtConct.Text; objBASEFILEDS.HTMAIN["theme_nm"] = cmbTheme.Text; objBASEFILEDS.HTMAIN["compid"] = objBASEFILEDS.ObjCompany.Compid; objBASEFILEDS.HTMAIN["deactfrm"] = dtpDeact.DtValue.ToString("yyyy/MM/dd"); if (objBASEFILEDS.Tran_mode == "add_mode") { objBASEFILEDS.HTMAIN["sec_code"] = VALIDATIONLAYER.Encrypt(txtUser.Text); } else { objBASEFILEDS.HTMAIN["sec_code"] = txtCode.Text; } DataSet ds = objDL_ADAPTER.dsquery("select comp_nm, fin_yr from org_mast where compid='" + objBASEFILEDS.ObjCompany.Compid + "'"); if (ds != null && ds.Tables.Count != 0 && ds.Tables[0].Rows.Count != 0) { objBASEFILEDS.HTMAIN["comp_nm"] = ds.Tables[0].Rows[0]["comp_nm"].ToString(); objBASEFILEDS.HTMAIN["fin_yr"] = ds.Tables[0].Rows[0]["fin_yr"].ToString(); } return(true); } else { AutoClosingMessageBox.Show("passwords don't match", "Validation", 3000); txtRpwd.Validating -= new CancelEventHandler(txtRpwd_Validating); txtRpwd.Clear(); return(false); } } else { AutoClosingMessageBox.Show("Please Enter Password", "Validation", 3000); return(false); } } else { AutoClosingMessageBox.Show("Enter User Name", "Validation", 3000); return(false); } }
private void btnDone_Click(object sender, EventArgs e) { bool flg = true; if (rbtnBasic.Checked) { if (chkInventory.Checked || chkProduction.Checked || chkPlanning.Checked) { MessageBox.Show("Sorry! checking Inventory,Production & Planning is not allowed."); flg = false; } } else if (rbtnExciseMfg.Checked) { if (chkJobWork.Checked) { MessageBox.Show("Sorry! checking Job Work is not allowed."); flg = false; } else { if (!((chkInventory.Checked && chkProduction.Checked) || (!chkInventory.Checked && !chkProduction.Checked))) { MessageBox.Show("Sorry! checking either Inventory or Production is not allowed."); flg = false; } if (chkPlanning.Checked) { if (!chkProduction.Checked) { MessageBox.Show("Sorry! checking Planning is not possible untill Production is not checked."); flg = false; } } } } else { if (chkInventory.Checked || chkProduction.Checked || chkPlanning.Checked || chkJobWork.Checked) { MessageBox.Show("Sorry! checking Inventory,Production,Planning & Job Work is not allowed."); flg = false; } } if (flg) { strModuleCode = ""; if (rbtnBasic.Checked) { strModuleCode = strModuleCode != "" ? strModuleCode + "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("BSIC") : VALIDATIONLAYER.Encrypt("BSIC"); } else if (rbtnExciseMfg.Checked) { strModuleCode = strModuleCode != "" ? strModuleCode + "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("BMFG") : VALIDATIONLAYER.Encrypt("BMFG"); } else { strModuleCode = strModuleCode != "" ? strModuleCode + "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("BTRD") : VALIDATIONLAYER.Encrypt("BTRD"); } if (chkMarketing.Checked) { strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("MKTG"); } if (chkProcurement.Checked) { strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("PRCM"); } if (chkInventory.Checked) { strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("INVT"); } if (chkProduction.Checked) { strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("PROD"); } if (chkPlanning.Checked) { strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("PLAN"); } if (chkQuality.Checked) { strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("QUAL"); } if (chkJobWork.Checked) { strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("JOBW"); } if (chkWarehouse.Checked) { strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("WRHS"); } if (chkGraphics.Checked) { strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("GRAP"); } objBSFD.HTMAIN["module_cd"] = strModuleCode; this.Close(); } }