protected void Find_Click(object sender, EventArgs e) { //create an instance of the trainer class clsSession ASession = new clsSession(); //variable to store the primary key Int32 SessionID; //variable to store the result of the find operation Boolean Found = false; //get the primary key entered by the user SessionID = Convert.ToInt32(txtSessionID.Text); //find the record Found = ASession.Find(SessionID); //if found if (Found == true) { //display the values of the properties in the form txtTrainerID.Text = ASession.TrainerID.ToString(); txtBranchID.Text = ASession.BranchID.ToString(); txtType.Text = ASession.SessionType; txtCost.Text = ASession.Cost.ToString(); txtDateTime.Text = ASession.DateTime.ToString(); chkEquipmentRequired.Checked = ASession.EquipmentRequired; } }
protected void Page_Load(object sender, EventArgs e) { //create a new instance of clsSession clsSession ASession = new clsSession(); //get the data from the session object ASession = (clsSession)Session["ASession"]; //display the session for this entry Response.Write(ASession.SessionID); Response.Write("<br>"); Response.Write(ASession.TrainerID); Response.Write("<br>"); Response.Write(ASession.BranchID); Response.Write("<br>"); Response.Write(ASession.SessionType); Response.Write("<br>"); Response.Write(ASession.Cost); Response.Write("<br>"); Response.Write(ASession.DateTime); Response.Write("<br>"); Response.Write(ASession.EquipmentRequired); }
protected void Page_Load(object sender, EventArgs e) { Session["Changed"] = false; Page.Header.DataBind(); if (Session["user"] == null) { if (Session.SessionID != "" | Session.SessionID != null) { clsSession ses = clsSessionManager.getSession(Session.SessionID); if (ses != null) { Session["user"] = ses.UserId; Session["book"] = "AMB"; string connectionString = DataManager.OraConnString(); SqlDataReader dReader; SqlConnection conn = new SqlConnection(); conn.ConnectionString = connectionString; SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select user_grp,description from utl_userinfo where upper(user_name)=upper('" + Session["user"].ToString().ToUpper() + "') and status='A'"; conn.Open(); dReader = cmd.ExecuteReader(); string wnot = ""; if (dReader.HasRows == true) { while (dReader.Read()) { Session["userlevel"] = int.Parse(dReader["user_grp"].ToString()); wnot = dReader["description"].ToString(); } Session["wnote"] = wnot; cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select book_desc,company_address1,company_address2,separator_type from gl_set_of_books where book_name='" + Session["book"].ToString() + "' "; if (dReader.IsClosed == false) { dReader.Close(); } dReader = cmd.ExecuteReader(); if (dReader.HasRows == true) { while (dReader.Read()) { Session["septype"] = dReader["separator_type"].ToString(); Session["org"] = dReader["book_desc"].ToString(); Session["add1"] = dReader["company_address1"].ToString(); Session["add2"] = dReader["company_address2"].ToString(); } } } dReader.Close(); conn.Close(); } } } }
public static void CreateSession(clsSession ses) { String connectionString = DataManager.OraConnString(); string query = " insert into user_session (session_id,session_time,mac,user_id) values (" + " '" + ses.SessionId + "', convert(datetime,'" + ses.SessionTime + "'), '" + ses.Mac + "', '" + ses.UserId + "')"; DataManager.ExecuteNonQuery(connectionString, query); }
protected void lnkLogOut_Click(object sender, EventArgs e) { Session["GreenApple"] = new clsSession(); ((clsSession)Session["GreenApple"]).Login = ""; ((clsSession)Session["GreenApple"]).Password = ""; ((clsSession)Session["GreenApple"]).IDUtente = "0"; Response.Redirect("Home.aspx"); }
protected new void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); if (Session["GreenApple"] == null) { Session["GreenApple"] = new clsSession(); } Control myUserControl; string action = "Green_Home_Cruscotto.ascx"; myUserControl = LoadControl(clsCostanti.RootUserControls + action); phContent1.Controls.Add(myUserControl); }
protected void Button1_Click(object sender, EventArgs e) { //create a new instance of clsTrainer clsSession ASession = new clsSession(); //capture all data for validation string TrainerID = txtTrainerID.Text; string BranchID = txtBranchID.Text; string DateTime = txtDateTime.Text; string SessionType = txtType.Text; string Cost = txtCost.Text; //variable to store error messages string Error = ""; Error = ASession.Valid(TrainerID, BranchID, SessionType, DateTime, Cost); if (Error == "") { ASession.SessionID = SessionID; ASession.TrainerID = Convert.ToInt32(TrainerID); ASession.BranchID = Convert.ToInt32(BranchID); ASession.DateTime = Convert.ToDateTime(DateTime); ASession.SessionType = SessionType; ASession.Cost = Decimal.Parse(Cost); ASession.EquipmentRequired = chkEquipmentRequired.Checked; clsSessionCollection SessionList = new clsSessionCollection(); if (SessionID == -1) { SessionList.ThisSession = ASession; SessionList.Add(); } else { SessionList.ThisSession.Find(SessionID); SessionList.ThisSession = ASession; SessionList.Update(); } Response.Redirect("SessionList.aspx"); } else { lblError.Text = Error; } }
void PopulateArray(clsDataConnection DB) { Int32 Index = 0; Int32 RecordCount; RecordCount = DB.Count; mSessionList = new List <clsSession>(); while (Index < RecordCount) { clsSession ASession = new clsSession(); ASession.SessionID = Convert.ToInt32(DB.DataTable.Rows[Index]["SessionID"]); ASession.TrainerID = Convert.ToInt32(DB.DataTable.Rows[Index]["TrainerID"]); ASession.BranchID = Convert.ToInt32(DB.DataTable.Rows[Index]["BranchID"]); ASession.SessionType = Convert.ToString(DB.DataTable.Rows[Index]["SessionType"]); ASession.Cost = Convert.ToDecimal(DB.DataTable.Rows[Index]["Cost"]); ASession.DateTime = Convert.ToDateTime(DB.DataTable.Rows[Index]["DateTime"]); ASession.EquipmentRequired = Convert.ToBoolean(DB.DataTable.Rows[Index]["EquipmentRequired"]); mSessionList.Add(ASession); Index++; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { if (Session.SessionID != "" | Session.SessionID != null) { clsSession ses = clsSessionManager.getSession(Session.SessionID); if (ses != null) { Session["user"] = ses.UserId; Session["wnote"] = UsersManager.getUserName(ses.UserId); Session["book"] = "AMB"; string connectionString = DataManager.OraConnString(); SqlDataReader dReader; SqlConnection conn = new SqlConnection(); conn.ConnectionString = connectionString; SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select ID,user_grp,description from utl_userinfo where upper(user_name)=upper('" + Session["user"].ToString().ToUpper() + "') and status='A'"; conn.Open(); dReader = cmd.ExecuteReader(); string wnot = ""; if (dReader.HasRows == true) { while (dReader.Read()) { Session["userlevel"] = int.Parse(dReader["user_grp"].ToString()); wnot = dReader["description"].ToString(); } Session["wnote"] = wnot; Session["USER_ID"] = dReader["ID"].ToString(); cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select book_desc,company_address1,company_address2,separator_type from gl_set_of_books where book_name='" + Session["book"].ToString() + "' "; if (dReader.IsClosed == false) { dReader.Close(); } dReader = cmd.ExecuteReader(); if (dReader.HasRows == true) { while (dReader.Read()) { Session["septype"] = dReader["separator_type"].ToString(); Session["org"] = dReader["book_desc"].ToString(); Session["add1"] = dReader["company_address1"].ToString(); Session["add2"] = dReader["company_address2"].ToString(); } } } dReader.Close(); conn.Close(); } } } try { string pageName = DataManager.GetCurrentPageName(); string modid = PermisManager.getModuleId(pageName); per = PermisManager.getUsrPermis(Session["user"].ToString().Trim().ToUpper(), modid); if (per != null & per.AllowView == "Y") { ((Label)Page.Master.FindControl("lblLogin")).Text = Session["wnote"].ToString(); ((LinkButton)Page.Master.FindControl("lbLogout")).Visible = true; } else { Response.Redirect("Home.aspx?sid=sam"); } } catch { Response.Redirect("Default.aspx?sid=sam"); } if (!IsPostBack) { RefreshAll(); } }
public bool EnrolluserInCanceledSession(object[] lStrvalue) { clsGlobalVariable.strExceptionReport = string.Empty; string statusCode = string.Empty; string result = string.Empty; clsGeneric oGeneric = new clsGeneric(); Hashtable htblTestData = new Hashtable(); htblTestData = oGeneric.GetTestData(lStrvalue); string URI = string.Empty; List <string> lCourseId = new List <string>(); bool _Flag = false; string _UserID = string.Empty; try { clsPage oPage = new clsPage(iWebdriver); _orgID = oPage.GetOrganizationID(); clsAPI.orgID = _orgID; lCourseId = oPage.GetCourseId(htblTestData["CourseName"].ToString()); Users oUser = new Users(); GetAPICredentials oGetAPICredentials = new GetAPICredentials(); oGeneric.GetApiResponseCodeData(out statusCode, out result, "GET", ApplicationSettings.APIURI() + clsAPI.orgCredential.Replace("$", _orgID), oUser, "H2", "", ""); var orgCredential = JsonConvert.DeserializeObject <GetAPICredentials>(result); Crypto3DES _des = new Crypto3DES(ApplicationSettings.EComModuleEncKey()); _ecomTransactionKey = _des.Decrypt3DES(orgCredential.TransactionKey); _ecomLoginKey = _des.Decrypt3DES(orgCredential.LoginID); oGeneric.GetApiResponseCodeData(out statusCode, out result, "GET", ApplicationSettings.APIURI() + clsAPI.user.Replace("{orgid}", _orgID), oUser, "H1", _ecomLoginKey, _ecomTransactionKey); var oUserData = JsonConvert.DeserializeObject <List <Users> >(result); for (int iUser = 0; iUser < oUserData.Count; iUser++) { if (oUserData[iUser].Profile.F015.ToString() == htblTestData["UserEmail"].ToString().Trim()) { _UserID = oUserData[iUser].ID; break; } } oGeneric.GetApiResponseCodeData(out statusCode, out result, "GET", ApplicationSettings.APIURI() + clsAPI.GetSessionID.Replace("{orgid}", _orgID).Replace("{CourseID}", lCourseId[0].ToString()), oUser, "H1", _ecomLoginKey, _ecomTransactionKey); var oSessionData = JsonConvert.DeserializeObject <List <clsAPISession> >(result); if (result == "") { return(false); } _SessionID = oSessionData[0].SessionID; clsSession oSession = new clsSession(iWebdriver); if (htblTestData["Function"].ToString().ToUpper() == "CANCEL") { oSession.CancelSession(htblTestData["CourseName"].ToString(), "CANCEL"); } else { oSession.CancelSession(htblTestData["CourseName"].ToString(), "Delete"); } UserEnrollment oUserEnrollment = new ILMS.UserEnrollment(); oUserEnrollment.userid = _UserID; oGeneric.GetApiResponseCodeData(out statusCode, out result, "POST", ApplicationSettings.APIURI() + clsAPI.SessionEnrollment.Replace("{orgid}", _orgID).Replace("{CourseID}", lCourseId[0].ToString().Trim()).Replace("{SessionID}", _SessionID), oUserEnrollment, "H1", _ecomLoginKey, _ecomTransactionKey); Thread.Sleep(clsGlobalVariable.iWaitHigh); if (htblTestData["TestCaseType"].ToString().ToUpper() == "NEGATIVE") { if (result.ToUpper().Contains("!DOCTYPE")) { clsGlobalVariable.strExceptionReport = "Resource not found"; return(true); } if (result.Contains("Invalid URI")) { return(true); } var oError = JsonConvert.DeserializeObject <List <SuperAdminCoursePushDownError> >(result); SuperAdminCoursePushDownErrorCode oErrorCode = new SuperAdminCoursePushDownErrorCode(); foreach (string strErrorCode in oErrorCode.coursePushDownErrorCode) { if (strErrorCode == oError[0].ErrorCode) { _Flag = true; } } if (_Flag == true) { return(true); } else { clsGlobalVariable.strExceptionReport = "Negative Case Failed!"; return(false); } } do { oGeneric.GetApiResponseCodeData(out statusCode, out result, "GET", ApplicationSettings.APIURI() + clsAPI.SessionEnrollment.Replace("{orgid}", _orgID).Replace("{CourseID}", lCourseId[0].ToString().Trim()).Replace("{SessionID}", _SessionID), oUserEnrollment, "H1", _ecomLoginKey, _ecomTransactionKey); } while (result == ""); var oCourseData = JsonConvert.DeserializeObject <List <SessionEnrollment> >(result); for (int iUser = 0; iUser < oCourseData.Count; iUser++) { if (oCourseData[iUser].User.Profile_Basic.F015.ToString() == htblTestData["UserEmail"].ToString().Trim()) { _UserID = oCourseData[iUser].User.ID; _Flag = true; break; } else { _Flag = false; } } } catch (Exception e) { clsException.ExceptionHandler(e, iWebdriver, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name); return(false); } return(_Flag); }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { if (Session.SessionID != "" | Session.SessionID != null) { clsSession ses = clsSessionManager.getSession(Session.SessionID); if (ses != null) { Session["user"] = ses.UserId; Session["book"] = "AMB"; string connectionString = DataManager.OraConnString(); SqlDataReader dReader; SqlConnection conn = new SqlConnection(); conn.ConnectionString = connectionString; SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select user_grp,description from utl_userinfo where upper(user_name)=upper('" + Session["user"].ToString().ToUpper() + "') and status='A'"; conn.Open(); dReader = cmd.ExecuteReader(); string wnot = ""; if (dReader.HasRows == true) { while (dReader.Read()) { Session["userlevel"] = int.Parse(dReader["user_grp"].ToString()); wnot = "KHSC Mr. " + dReader["description"].ToString(); } Session["wnote"] = wnot; cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select book_desc,company_address1,company_address2,separator_type from gl_set_of_books where book_name='" + Session["book"].ToString() + "' "; if (dReader.IsClosed == false) { dReader.Close(); } dReader = cmd.ExecuteReader(); if (dReader.HasRows == true) { while (dReader.Read()) { Session["septype"] = dReader["separator_type"].ToString(); Session["org"] = dReader["book_desc"].ToString(); Session["add1"] = dReader["company_address1"].ToString(); Session["add2"] = dReader["company_address2"].ToString(); } } } dReader.Close(); conn.Close(); } } } try { //ClientScript.RegisterStartupScript(this.GetType(), "ale", "alert('" + Session.SessionID + "');", true); string pageName = DataManager.GetCurrentPageName(); string modid = PermisManager.getModuleId(pageName); per = PermisManager.getUsrPermis(Session["user"].ToString().Trim().ToUpper(), modid); if (per != null & per.AllowView == "Y") { ((Label)Page.Master.FindControl("lblLogin")).Text = Session["wnote"].ToString(); ((LinkButton)Page.Master.FindControl("lbLogout")).Visible = true; } else { Response.Redirect("Home.aspx?sid=sam"); } } catch { Response.Redirect("Default.aspx?sid=sam"); } if (!Page.IsPostBack) { DataTable dt = clsDesigManager.getDesigDetails(""); dgDesig.DataSource = dt; dgDesig.DataBind(); ddlMgrCode.Items.Clear(); string queryDesig = "select '' desig_code, '' desig_name union select desig_code,dbo.initcap(desig_name) desig_name from pmis_desig_code order by 2 desc"; util.PopulationDropDownList(ddlMgrCode, "Designation", queryDesig, "desig_name", "desig_code"); /*ddlGradeCode.Items.Clear(); * string queryScale = "select '' scale_detail_id, '' scale union select convert(scale_detail_id),scale from v_scale order by 2 desc"; * util.PopulationDropDownList(ddlGradeCode, "Scale", queryScale, "scale", "scale_detail_id"); */ ddlClass.Items.Clear(); string queryClass = "select '' class_id, '' class_name union select convert(varchar,class_id),class_name from pmis_class order by 2 desc"; util.PopulationDropDownList(ddlClass, "Scale", queryClass, "class_name", "class_id"); } }
protected void LoginBtn_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(3000); if (ddlBook.SelectedValue != "") { string connectionString = DataManager.OraConnString(); SqlDataReader dReader; SqlConnection conn = new SqlConnection(); conn.ConnectionString = connectionString; SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select ID,USER_NAME,password,user_grp,description from utl_userinfo where upper(user_name)=upper('" + txtUserName.Text.Trim() + "') and status='A'"; conn.Open(); dReader = cmd.ExecuteReader(); if (dReader.HasRows == true) { while (dReader.Read()) { if (txtPassword.Text != "" && txtPassword.Text.Trim() == (dReader["password"].ToString())) { Session["user"] = txtUserName.Text; Session["pass"] = txtPassword.Text; Session["USER_ID"] = dReader["ID"].ToString(); Session["user_grp"] = dReader["user_grp"].ToString(); userLvl = int.Parse(dReader["user_grp"].ToString()); Session["userlevel"] = userLvl.ToString(); Session["book"] = ddlBook.SelectedValue; //Session["dept"] = dReader["dept"].ToString(); string wnote = "Welcome Mr. " + dReader["description"].ToString(); Session["wnote"] = wnote; cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select book_desc,company_address1,company_address2,separator_type from gl_set_of_books where book_name='" + Session["book"].ToString() + "' "; if (dReader.IsClosed == false) { dReader.Close(); } dReader = cmd.ExecuteReader(); if (dReader.HasRows == true) { while (dReader.Read()) { Session["septype"] = dReader["separator_type"].ToString(); Session["org"] = dReader["book_desc"].ToString(); Session["add1"] = dReader["company_address1"].ToString(); Session["add2"] = dReader["company_address2"].ToString(); } } clsSession ses = clsSessionManager.getLoginSession(txtUserName.Text.ToUpper(), ""); if (ses == null) { ses = new clsSession(); ses.UserId = txtUserName.Text.ToUpper(); ses.SessionTime = System.DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss"); ses.SessionId = Session.SessionID; ses.Mac = Server.HtmlEncode(Request.UserHostAddress); //clsSessionManager.CreateSession(ses); } Response.Redirect("~/Home.aspx"); } } } else { Session["user"] = ""; Session["pass"] = ""; txtUserName.Focus(); } } else { Session["user"] = ""; Session["pass"] = ""; txtUserName.Focus(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { if (Session.SessionID != "" | Session.SessionID != null) { clsSession ses = clsSessionManager.getSession(Session.SessionID); if (ses != null) { Session["user"] = ses.UserId; Session["book"] = "AMB"; string connectionString = DataManager.OraConnString(); using (SqlConnection conn = new SqlConnection(connectionString)) { string query = "Select user_grp,description from utl_userinfo where upper(user_name)=upper('" + Session["user"].ToString().ToUpper() + "') and status='A'"; using (SqlCommand cmd = new SqlCommand(query, conn)) { cmd.CommandType = CommandType.Text; conn.Open(); using (SqlDataReader dreader = cmd.ExecuteReader()) { if (dreader.HasRows == true) { while (dreader.Read()) { Session["userlevel"] = int.Parse(dreader["user_grp"].ToString()); Session["wnote"] = "Welcome Mr. " + dreader["description"].ToString(); } } } } } using (SqlConnection conn = new SqlConnection(connectionString)) { string query = "Select book_desc,company_address1,company_address2,separator_type from gl_set_of_books where book_name='" + Session["book"].ToString() + "' "; using (SqlCommand cmd = new SqlCommand(query, conn)) { cmd.CommandType = CommandType.Text; conn.Open(); using (SqlDataReader dreader = cmd.ExecuteReader()) { if (dreader.HasRows == true) { while (dreader.Read()) { Session["septype"] = dreader["separator_type"].ToString(); Session["org"] = dreader["book_desc"].ToString(); Session["add1"] = dreader["company_address1"].ToString(); Session["add2"] = dreader["company_address2"].ToString(); } } } } } } } } try { //ClientScript.RegisterStartupScript(this.GetType(), "ale", "alert('" + ViewState.ViewStateID + "');", true); string pageName = DataManager.GetCurrentPageName(); string modid = PermisManager.getModuleId(pageName); per = PermisManager.getUsrPermis(Session["user"].ToString().Trim().ToUpper(), modid); if (per != null && per.AllowView == "Y") { ((Label)Page.Master.FindControl("lblLogin")).Text = Session["wnote"].ToString(); ((LinkButton)Page.Master.FindControl("lbLogout")).Visible = true; } else { Response.Redirect("Default.aspx?sid=sam"); } } catch { //ClientScript.RegisterStartupScript(this.GetType(), "ale", "alert('"+ex.Message+"!!');", true); Response.Redirect("Default.aspx?sid=sam"); } if (!IsPostBack) { } }
//public static ReportDocument rpt; //private static Permis per; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["user"] == null) { if (Session.SessionID != "" | Session.SessionID != null) { clsSession ses = clsSessionManager.getSession(Session.SessionID); if (ses != null) { Session["user"] = ses.UserId; Session["wnote"] = "KHSC Mr. " + UsersManager.getUserName(ses.UserId); Session["book"] = "AMB"; string connectionString = DataManager.OraConnString(); SqlDataReader dReader; SqlConnection conn = new SqlConnection(); conn.ConnectionString = connectionString; SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select user_grp,description from utl_userinfo where upper(user_name)=upper('" + Session["user"].ToString().ToUpper() + "') and status='A'"; conn.Open(); dReader = cmd.ExecuteReader(); string wnot = ""; if (dReader.HasRows == true) { while (dReader.Read()) { Session["userlevel"] = int.Parse(dReader["user_grp"].ToString()); wnot = "KHSC Mr. " + dReader["description"].ToString(); } Session["wnote"] = wnot; cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select book_desc,company_address1,company_address2,separator_type from gl_set_of_books where book_name='" + Session["book"].ToString() + "' "; if (dReader.IsClosed == false) { dReader.Close(); } dReader = cmd.ExecuteReader(); if (dReader.HasRows == true) { while (dReader.Read()) { Session["septype"] = dReader["separator_type"].ToString(); Session["org"] = dReader["book_desc"].ToString(); Session["add1"] = dReader["company_address1"].ToString(); Session["add2"] = dReader["company_address2"].ToString(); } } } dReader.Close(); conn.Close(); } } } ddlBranchId.Items.Clear(); string queryBranch = "select '' branch_code, '' branch_name union select branch_code,dbo.initcap(branch_name) branch_name from pmis_branch order by 2 desc"; util.PopulationDropDownList(ddlBranchId, "Branch", queryBranch, "branch_name", "branch_code"); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { if (Session.SessionID != "" | Session.SessionID != null) { clsSession ses = clsSessionManager.getSession(Session.SessionID); if (ses != null) { Session["user"] = ses.UserId; Session["wnote"] = "KHSC Mr. " + UsersManager.getUserName(ses.UserId); Session["book"] = "AMB"; string connectionString = DataManager.OraConnString(); SqlDataReader dReader; SqlConnection conn = new SqlConnection(); conn.ConnectionString = connectionString; SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select user_grp,description from utl_userinfo where upper(user_name)=upper('" + Session["user"].ToString().ToUpper() + "') and status='A'"; conn.Open(); dReader = cmd.ExecuteReader(); string wnot = ""; if (dReader.HasRows == true) { while (dReader.Read()) { Session["userlevel"] = int.Parse(dReader["user_grp"].ToString()); wnot = dReader["description"].ToString(); } Session["wnote"] = wnot; cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select book_desc,company_address1,company_address2,separator_type from gl_set_of_books where book_name='" + Session["book"].ToString() + "' "; if (dReader.IsClosed == false) { dReader.Close(); } dReader = cmd.ExecuteReader(); if (dReader.HasRows == true) { while (dReader.Read()) { Session["septype"] = dReader["separator_type"].ToString(); Session["org"] = dReader["book_desc"].ToString(); Session["add1"] = dReader["company_address1"].ToString(); Session["add2"] = dReader["company_address2"].ToString(); } } } dReader.Close(); conn.Close(); } } } if (!IsPostBack) { try { if (int.Parse(Session["userlevel"].ToString()) > 0) { pnlTask.Visible = true; lbAuthList.Visible = true; dgVoucher.Visible = true; dgVoucher.DataBind(); lbAuthList.Text = "Show: Authorization List"; } else { pnlTask.Visible = true; lbAuthList.Visible = false; } ((Label)Page.Master.FindControl("lblLogin")).Text = Session["wnote"].ToString(); ((LinkButton)Page.Master.FindControl("lbLogout")).Visible = true; lbAuthList.Visible = false; } catch { Session["user"] = ""; Session["pass"] = ""; pnlTask.Visible = false; Response.Redirect("Default.aspx?sid=sam"); } pnlChangePass.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { if (Session.SessionID != "" | Session.SessionID != null) { clsSession ses = clsSessionManager.getSession(Session.SessionID); if (ses != null) { Session["user"] = ses.UserId; Session["book"] = "AMB"; string connectionString = DataManager.OraConnString(); SqlDataReader dReader; SqlConnection conn = new SqlConnection(); conn.ConnectionString = connectionString; SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select user_grp,description from utl_userinfo where upper(user_name)=upper('" + Session["user"].ToString().ToUpper() + "') and status='A'"; conn.Open(); dReader = cmd.ExecuteReader(); string wnot = ""; if (dReader.HasRows == true) { while (dReader.Read()) { Session["userlevel"] = int.Parse(dReader["user_grp"].ToString()); wnot = "KHSC Mr. " + dReader["description"].ToString(); } Session["wnote"] = wnot; cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select book_desc,company_address1,company_address2,separator_type from gl_set_of_books where book_name='" + Session["book"].ToString() + "' "; if (dReader.IsClosed == false) { dReader.Close(); } dReader = cmd.ExecuteReader(); if (dReader.HasRows == true) { while (dReader.Read()) { Session["septype"] = dReader["separator_type"].ToString(); Session["org"] = dReader["book_desc"].ToString(); Session["add1"] = dReader["company_address1"].ToString(); Session["add2"] = dReader["company_address2"].ToString(); } } } dReader.Close(); conn.Close(); } } } try { //ClientScript.RegisterStartupScript(this.GetType(), "ale", "alert('" + Session.SessionID + "');", true); string pageName = DataManager.GetCurrentPageName(); string modid = PermisManager.getModuleId(pageName); per = PermisManager.getUsrPermis(Session["user"].ToString().Trim().ToUpper(), modid); if (per != null & per.AllowView == "Y") { ((Label)Page.Master.FindControl("lblLogin")).Text = Session["wnote"].ToString(); ((LinkButton)Page.Master.FindControl("lbLogout")).Visible = true; } else { Response.Redirect("Home.aspx?sid=sam"); } } catch { Response.Redirect("Default.aspx?sid=sam"); } if (!Page.IsPostBack) { //string queryBank = "select '' BANK_ID, '' BANK_NAME union select BANK_ID,BANK_NAME from BANK_INFO order by 1"; //util.PopulationDropDownList(ddlBankNo, "Bank", queryBank, "BANK_NAME", "BANK_ID"); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { if (Session.SessionID != "" | Session.SessionID != null) { clsSession ses = clsSessionManager.getSession(Session.SessionID); if (ses != null) { Session["user"] = ses.UserId; Session["book"] = "AMB"; string connectionString = DataManager.OraConnString(); SqlDataReader dReader; SqlConnection conn = new SqlConnection(); conn.ConnectionString = connectionString; SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select user_grp,description from utl_userinfo where upper(user_name)=upper('" + Session["user"].ToString().ToUpper() + "') and status='A'"; conn.Open(); dReader = cmd.ExecuteReader(); string wnot = ""; if (dReader.HasRows == true) { while (dReader.Read()) { Session["userlevel"] = int.Parse(dReader["user_grp"].ToString()); wnot = dReader["description"].ToString(); } Session["wnote"] = wnot; cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select book_desc,company_address1,company_address2,separator_type from gl_set_of_books where book_name='" + Session["book"].ToString() + "' "; if (dReader.IsClosed == false) { dReader.Close(); } dReader = cmd.ExecuteReader(); if (dReader.HasRows == true) { while (dReader.Read()) { Session["septype"] = dReader["separator_type"].ToString(); Session["org"] = dReader["book_desc"].ToString(); Session["add1"] = dReader["company_address1"].ToString(); Session["add2"] = dReader["company_address2"].ToString(); } } } dReader.Close(); conn.Close(); } } } try { string pageName = DataManager.GetCurrentPageName(); string modid = PermisManager.getModuleId(pageName); per = PermisManager.getUsrPermis(Session["user"].ToString().Trim().ToUpper(), modid); if (per != null && per.AllowView == "Y") { ((Label)Page.Master.FindControl("lblLogin")).Text = Session["wnote"].ToString(); ((LinkButton)Page.Master.FindControl("lbLogout")).Visible = true; } else { Response.Redirect("Default.aspx?sid=sam"); } } catch { Response.Redirect("Default.aspx?sid=sam"); } if (!IsPostBack) { try { DataTable dt = StudentManager.GetStudentAllCurrentStatus("", "", "", ""); dgPayHistory.DataSource = dt; dgPayHistory.DataBind(); } catch (FormatException fex) { ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('" + fex.Message + "');", true); } catch (Exception ex) { if (ex.Message.Contains("Database")) { ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('Database Maintain Error. Contact to the Software Provider..!!');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('There is some problem to do the task. Try again properly.!!');", true); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { if (Session.SessionID != "" | Session.SessionID != null) { clsSession ses = clsSessionManager.getSession(Session.SessionID); if (ses != null) { Session["user"] = ses.UserId; Session["book"] = "AMB"; string connectionString = DataManager.OraConnString(); SqlDataReader dReader; SqlConnection conn = new SqlConnection(); conn.ConnectionString = connectionString; SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select ID,user_grp,description from utl_userinfo where upper(user_name)=upper('" + Session["user"].ToString().ToUpper() + "') and status='A'"; conn.Open(); dReader = cmd.ExecuteReader(); string wnot = ""; if (dReader.HasRows == true) { while (dReader.Read()) { Session["userlevel"] = int.Parse(dReader["user_grp"].ToString()); wnot = dReader["description"].ToString(); Session["userID"] = dReader["ID"].ToString(); } Session["wnote"] = wnot; cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select book_desc,company_address1,company_address2,separator_type from gl_set_of_books where book_name='" + Session["book"].ToString() + "' "; if (dReader.IsClosed == false) { dReader.Close(); } dReader = cmd.ExecuteReader(); if (dReader.HasRows == true) { while (dReader.Read()) { Session["septype"] = dReader["separator_type"].ToString(); Session["org"] = dReader["book_desc"].ToString(); Session["add1"] = dReader["company_address1"].ToString(); Session["add2"] = dReader["company_address2"].ToString(); } } } dReader.Close(); conn.Close(); } } } if (!IsPostBack) { Refresh(); //lblDepartment.Text = Request.QueryString["DepartmentName"]; //lblFaculty.Text = Request.QueryString["Faculty"]; //lblSubjectName.Text = Request.QueryString["SubjectName"]; //lblYear.Text = Request.QueryString["StudyYear"]; ////lblID.Text = Request.QueryString["ID"].Trim().Replace(" ",""); //lblMstId.Text = Request.QueryString["OfferMstID"]; //lblFlag.Text = Request.QueryString["Flag"]; //lblUserID.Text = Request.QueryString["UserID"]; //DateTime dtt = DateTime.Now; //DataTable dtt = clsSubOfferManager.GetShowAllSubjectSedule(lblMstId.Text); if (lblFlag.Text == "O") { if (Session["ShList"] != null) { DataTable dtt = (DataTable)Session["ShList"]; DataRow[] rows = dtt.Select("ID ='" + lblID.Text + "'"); if (rows.Length <= 0) { DataTable dt = clsSubOfferManager.GetShowSheduleInSubject(txtBatchNo.Text, txtBatchNo.Text); if (dt.Rows.Count > 0) { Session["ShList"] = dt; ViewState["Flag"] = 1; } } } else { DataTable dt = clsSubOfferManager.GetShowSheduleInSubject(txtBatchNo.Text, txtBatchNo.Text); if (dt.Rows.Count > 0) { Session["ShList"] = dt; ViewState["Flag"] = 1; } } } if (Session["ShList"] != null) { DataTable dt = (DataTable)Session["ShList"]; if (dt.Rows.Count > 0) { DataRow[] rows = dt.Select("ID ='" + lblID.Text + "'"); if (rows.Length > 0) { DataTable dtResult = dt.Select("ID='" + lblID.Text + "'").CopyToDataTable(); if (dtResult.Rows.Count > 0) { ViewState["itemdtl"] = dtResult; DataRow dr = dtResult.NewRow(); dtResult.Rows.Add(dr); dgSubSedule.DataSource = dtResult; dgSubSedule.DataBind(); ViewState["Flag"] = 1; } } else { getEmptyDtl(); ViewState["Flag"] = "0"; } } else { getEmptyDtl(); } } else { getEmptyDtl(); ViewState["Flag"] = "0"; } } }