protected void Page_Load(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(Session["User_ID"].ToString())) { Response.Redirect("LoginPage.aspx"); } userid = Session["User_Id"].ToString(); } catch (Exception) { Response.Redirect("/pages/examples/LoginPage.aspx"); } if (string.IsNullOrEmpty(Session["User_ID"].ToString())) { Response.Redirect("LoginPage.aspx"); } else { try { if (Session["User_ID"] != null) { string storeid = Convert.ToString(CommanFile.ExcuteScalar_YS($@" SELECT[Store_ID] FROM [CreditManagement].[dbo].[Store] where User_ID = '{userid}' ")); string totalcoustomers = Convert.ToString(CommanFile.ExcuteScalar_YS($@" Select count(*) from [Store_Customers] where Store_ID = '{storeid}' ")); lblNumberofuser_YS.Text = totalcoustomers; } else { Response.Redirect("pages/examples/LoginPage.aspx"); } } catch (Exception) { Response.Redirect("pages/examples/LoginPage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { try { userid = Session["User_ID"].ToString(); } catch (Exception) { Response.Redirect("SessionErrorMessage.aspx"); } if (Session["User_ID"] != null && Session["Display_Name"] != null) { lblName_YS.Text = Session["Display_Name"].ToString(); lblcustomername_YS.Text = Session["Display_Name"].ToString(); } imgUserImage_YS.ImageUrl = $@"{("~/Images/" + userid + ".jpg")}"; Boolean isstorekeeper = Convert.ToBoolean(CommanFile.ExcuteScalar_YS($@" select Is_Storekeeper From [User] where User_ID = '{userid}' ")); Session["isstorekeeper"] = isstorekeeper; int storenotification = Convert.ToInt32(CommanFile.ExcuteScalar_YS($@" select count(*) FRom Store_Customer_Request where Customer_ID ='{userid}' and CU_Request_Status='A' or CU_Request_Status='R' ")); int totalrequest = storenotification; if (totalrequest > 0) { lbltotalrequest_YS.Text = Convert.ToString(totalrequest); } if (storenotification > 0) { lblgetrequest_YS.Text = Convert.ToString(storenotification + " Store Notification"); } else { lblgetrequest_YS.Text = "No any Request"; } }
protected void Page_Load(object sender, EventArgs e) { try { userid = Session["User_ID"].ToString(); } catch (Exception) { Response.Redirect("/pages/examples/LoginPage.aspx"); } if (string.IsNullOrEmpty(Session["User_ID"].ToString())) { Response.Redirect("LoginPage.aspx"); } else { string userid = Session["User_ID"].ToString(); if (Session["User_ID"] != null) { customerid = Convert.ToString(CommanFile.ExcuteScalar_YS($@" SELECT[Customer_ID] ,[User_ID] FROM[CreditManagement].[dbo].[Customers] where User_ID = '{userid}' ")); string totaluser = Convert.ToString(CommanFile.ExcuteScalar_YS($@" SELECT Count([CU_Request_Status]) FROM [CreditManagement].[dbo].[Store_Customer_Request] where Customer_ID = '{customerid}' and CU_Request_Status = 'A' ")); string customercredit = Convert.ToString(CommanFile.ExcuteScalar_YS($@" select Credit From Store_Customers where Customer_ID = '{customerid}' ")); lblNumberofuser_YS.Text = totaluser; lblCustomerCredit.Text = customercredit; } else { Response.Redirect("pages/examples/LoginPage.aspx"); } } }