protected void btnSubmit_Click(object sender, EventArgs e) { try { InterConnect.LeshLaonApi.ClientDetails clientDet = GetClientDetails(); if (string.IsNullOrEmpty(clientDet.ClientPhoto) || string.IsNullOrEmpty(clientDet.IDPhoto)) { ShowMessage("Please Upload Photo(s)", true); return; } string Password = clientDet.ClientPassword; clientDet.ClientPassword = SharedCommons.GenerateUserPassword(clientDet.ClientPassword); Result client_save = Client.SaveClientDetails(clientDet); if (client_save.StatusCode != "0") { //MultiView2.ActiveViewIndex = 0; ShowMessage(client_save.StatusDesc, true); return; } ShowMessage("CLIENT SAVED SUCCESSFULLY", false); Clear_controls(); bll.SendCredentialsToClientUser(clientDet, Password); bll.InsertIntoAuditLog("USER-CREATION", "SYSTEMUSERS", user.CompanyCode, user.UserId, "USER " + clientDet.ClientNo + " CREATED SUCCESSFULLY"); } catch (Exception ex) { } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { bool isHuman = captchaBox.Validate(txtCaptcha.Text); txtCaptcha.Text = null; if (!isHuman) { //The Captcha entered by user is Invalid. //ShowMessage("Captcha doesnot match", true); lblCaptchaError.Visible = true; lblCaptchaError.Text = "Captcha doesnot match"; lblCaptchaError.ForeColor = System.Drawing.Color.Red; lblmsg.Font.Bold = true; return; } //The Captcha entered by user is Valid. lblCaptchaError.Visible = false; InterConnect.LeshLaonApi.ClientDetails clientDet = GetClientDetails(); string Password = clientDet.ClientPassword; clientDet.ClientPassword = SharedCommons.GenerateUserPassword(clientDet.ClientPassword); Result client_save = Client.SaveClientDetails(clientDet); if (client_save.StatusCode != "0") { //MultiView2.ActiveViewIndex = 0; ShowMessage(client_save.StatusDesc, true); return; } //ShowMessage("", false); lblmsg.Text = "CLIENT SAVED SUCCESSFULLY"; lblmsg.ForeColor = System.Drawing.Color.Green; lblmsg.Font.Bold = true; Clear_controls(); bll.SendCredentialsToClientUser(clientDet, Password); bll.InsertIntoAuditLog("USER-CREATION", "SYSTEMUSERS", "Lensh", txtClientNo.Text, "USER " + clientDet.ClientNo + "CREATED SUCCESSFULLY"); Response.Redirect("Default.aspx"); } catch (Exception ex) { } }
protected void btnApprove_Click() { Label lblmsg = (Label)Master.FindControl("lblmsg"); try { string msg = ""; SystemUser aclient = GetSystemUserToEdit(); string Password = aclient.Password; aclient.Password = SharedCommons.GenerateUserPassword(aclient.Password); if (chkActive.Checked) { Result result = bll.ReActivateUser(aclient, user.UserId, "ACTIVATE"); if (result.StatusCode != Globals.SUCCESS_STATUS_CODE) { msg = "FAILED: " + result.StatusDesc; bll.ShowMessage(lblmsg, msg, true, Session); return; } msg = "SYSTEM USER DETAILS ACTIVATED SUCCESSFULLY. AN EMAIL WITH CREDENTIALS HAS BEEN SENT TO THE USER EMAIL"; bll.ShowMessage(lblmsg, msg, false, Session); Clear_contrls(); bll.SendCredentialsToUser(aclient, Password); bll.InsertIntoAuditLog("APPROVE-USER", "SYSTEMUSERS", user.CompanyCode, user.UserId, "USER " + aclient.UserId + " ACTIVATED AND APPROVED SUCCESSFULLY"); return; } msg = "SYSTEM USER STILL INACTIVE"; bll.ShowMessage(lblmsg, msg, true, Session); } catch (Exception ex) { bll.LogError(user.CompanyCode, "", "APPROVE-SYSTEM USER" + ex.Message + ex.StackTrace, "EXCEPTION", "", ""); bll.ShowMessage(lblmsg, ex.Message, true, Session); } }
protected void btnOK_Click(object sender, EventArgs e) { try { SystemUser RegUser = GetSystemUserDetails(); string Password = RegUser.Password; RegUser.Password = SharedCommons.GenerateUserPassword(RegUser.Password); // bool reset = CheckBox1.Checked; string check_status = validate_input(RegUser.Name, RegUser.Name, RegUser.UserId, RegUser.RoleCode); if (!check_status.Equals("OK")) { ShowMessage(check_status, true); } else { Result user_save = Client.SaveSystemUser(RegUser); if (user_save.StatusCode != "0") { //MultiView2.ActiveViewIndex = 0; ShowMessage(user_save.StatusDesc, true); return; } ShowMessage("USER SAVED SUCCESSFULLY", false); Clear_contrls(); //bll.SendCredentialsToUser(RegUser, Password); bll.InsertIntoAuditLog("USER-CREATION", "SYSTEMUSERS", user.CompanyCode, user.UserId, "USER " + RegUser.UserId + " CREATED SUCCESSFULLY"); } } catch (Exception ex) { ShowMessage(ex.Message, true); } }
//protected void ddlAreas_DataBound(object sender, EventArgs e) //{ // ddlAreas.Items.Insert(0, new ListItem(" Select Vendor ", "0")); //} protected void btnEdit_Click(object sender, EventArgs e) { Label lblmsg = (Label)Master.FindControl("lblmsg"); try { Result result; string msg = ""; SystemUser aclient = GetSystemUserToEdit(); string Password = aclient.Password; aclient.Password = SharedCommons.GenerateUserPassword(aclient.Password); if (ChkReset.Checked) { result = bll.ReActivateUser(aclient, user.UserId, "RESET"); if (result.StatusCode != Globals.SUCCESS_STATUS_CODE) { msg = "FAILED: " + result.StatusDesc; bll.ShowMessage(lblmsg, msg, true, Session); return; } msg = "SYSTEM USER DETAILS RESET SUCCESSFULLY"; bll.ShowMessage(lblmsg, msg, false, Session); Clear_contrls(); bll.SendCredentialsToUser(aclient, Password); bll.InsertIntoAuditLog("RESET-USER", "SYSTEMUSERS", user.CompanyCode, user.UserId, "USER " + aclient.UserId + " PASSWORD RESET SUCCESSFULLY"); //return; } else if (chkActive.Checked) { result = bll.ReActivateUser(aclient, user.UserId, "JUSTACTIVATE"); if (result.StatusCode != Globals.SUCCESS_STATUS_CODE) { msg = "FAILED: " + result.StatusDesc; bll.ShowMessage(lblmsg, msg, true, Session); return; } msg = "SYSTEM USER ACTIVATED SUCCESSFULLY."; bll.ShowMessage(lblmsg, msg, false, Session); Clear_contrls(); bll.SendCredentialsToUser(aclient, Password); bll.InsertIntoAuditLog("ACTIVATE-USER", "SYSTEMUSERS", user.CompanyCode, user.UserId, "USER " + aclient.UserId + " ACTIVATED SUCCESSFULLY"); //return; } else if (ChkDeactivate.Checked) { result = bll.ReActivateUser(aclient, user.UserId, "DEACTIVATE"); if (result.StatusCode != Globals.SUCCESS_STATUS_CODE) { msg = "FAILED: " + result.StatusDesc; bll.ShowMessage(lblmsg, msg, true, Session); return; } msg = "SYSTEM USER DETAILS DE-ACTIVATED SUCCESSFULLY."; bll.ShowMessage(lblmsg, msg, false, Session); Clear_contrls(); //bll.SendCredentialsToUser(aclient, Password); bll.InsertIntoAuditLog("DEACTIVATE-USER", "SYSTEMUSERS", user.CompanyCode, user.UserId, "USER " + aclient.UserId + " DE-ACTIVATED SUCCESSFULLY"); //return; } else { result = bll.ReActivateUser(aclient, user.UserId, "EDITUSER"); if (result.StatusCode != Globals.SUCCESS_STATUS_CODE) { msg = "FAILED: " + result.StatusDesc; bll.ShowMessage(lblmsg, msg, true, Session); return; } msg = "SYSTEM USER DETAILS EDITED SUCCESSFULLY."; bll.ShowMessage(lblmsg, msg, false, Session); Clear_contrls(); //bll.SendCredentialsToUser(aclient, Password); bll.InsertIntoAuditLog("EDIT-USER", "SYSTEMUSERS", user.CompanyCode, user.UserId, "USER " + aclient.UserId + " EDITED SUCCESSFULLY"); } } catch (Exception ex) { bll.LogError(user.CompanyCode, "", "EDIT-SYSTEM USER" + ex.Message + ex.StackTrace, "EXCEPTION", "", ""); bll.ShowMessage(lblmsg, ex.Message, true, Session); } }