protected void btnSearchPassAdd_Click(object sender, EventArgs e) { log4net.ILog logger = log4net.LogManager.GetLogger("File"); try { AddNewPassRequest objAddPass = new AddNewPassRequest(); Pass ObjPass = new Pass(); if (ddlAddPassType.Text.Trim() != "" && txtAddNoType.Text.Trim() != "") { String q1 = txtKeyNRIC.Text.Trim(); DataSet ds1 = dal.getdataset("select NRICno from UserInformation"); for (int i = 0; i < ds1.Tables[0].Rows.Count; i++) { String z = ds1.Tables[0].Rows[i].ItemArray[0].ToString(); if (string.Equals(q1, z, StringComparison.CurrentCultureIgnoreCase)) { getLocationIDByName(ddllocation.Text.Trim()); ObjPass.pass_Type = ddlAddPassType.Text; ObjPass.Pass_No = txtAddNoType.Text; ObjPass.Pass_Desciption = txtPassDecription.Text; ObjPass.Date_From = Convert.ToDateTime(DateTime.Now); ObjPass.Pass_Status = txtstatus.Text; ObjPass.Staff_ID = txtKeyNRIC.Text; ObjPass.Location_id = SearchLocID.Text; AdminBLL ws = new AdminBLL(); ws.AddUserPass(ObjPass); lblerror.Visible = true; lblerror.Text = "Add Successfully....!"; break; // HttpContext.Current.Items.Add("COMPLETE", "INSERT"); // Server.Transfer("..//SMSADMIN//AlertUpdateComplete.aspx"); } else { lblerror.Visible = true; lblerror.Text = "Invalid NRICNo....!"; lblerr2.Visible = true; } } //throw new Exception(); } else { lblerror.Visible = true; lblerror.Text = "Please Select Pass Detail ..!"; lblerr5.Visible = true; } } catch (Exception ex) { logger.Info(ex.Message); } }
protected void Add_Pass(object sender, EventArgs e) { AddNewPassRequest objAddPass = new AddNewPassRequest(); Pass ObjPass = new Pass(); ObjPass.pass_Type = txtAddPassType.Text; ObjPass.Pass_No = txtEnterPassNumber.Text; ObjPass.Pass_Desciption = txtPassDecription.Text; AdminBLL ws = new AdminBLL(); ws.AddUserPass(ObjPass); HttpContext.Current.Items.Add("COMPLETE", "INSERT"); Server.Transfer("..//SMSADMIN//AddNewUserComplete.aspx"); }