Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session[sessionNames.userID_StudentOstad] != null)
     {
         DataTable dt = new DataTable();
         dt = EmailBuss.GetEmailRequestStatus(Session[sessionNames.userID_StudentOstad].ToString());
         if (dt.Rows.Count > 0 && dt.Rows[dt.Rows.Count - 1]["Status"].ToString() == "2")
         {
             newrequest.Visible = true;
         }
         if (dt.Rows.Count > 0 && dt.Rows[dt.Rows.Count - 1]["Status"].ToString() == "4")
         {
             gotoemail.Visible  = true;
             ChangePass.Visible = true;
             //UserName.InnerText = dt.Rows[dt.Rows.Count - 1]["Email_Address"].ToString();
             //Usernameli.Visible = true;
         }
         if (!IsPostBack)
         {
             LoginBusiness lgnB = new LoginBusiness();
             StuImg        st   = lgnB.User_Img(Session[sessionNames.userID_StudentOstad].ToString());
             PersonalImage.DataValue = st.img;
             LoginDTO stInfo = lgnB.Get_StInfo(Session[sessionNames.userID_StudentOstad].ToString());
             stName.InnerText = stInfo.Name + " " + stInfo.LastName;
             //stName.InnerText = stInfo.LastName;
         }
     }
     else
     {
         Response.Redirect("~/CommonUI/login.aspx", false);
     }
 }
        protected void Page_init(object sender, EventArgs e)
        {
            if (Session[sessionNames.userID_StudentOstad] == null)
            {
                Response.Redirect("~/CommonUI/login.aspx", false);
            }
            if (!IsPostBack)
            {
                LoginBusiness lgnB = new LoginBusiness();
                StuImg        st   = lgnB.User_Img(Session[sessionNames.userID_StudentOstad].ToString());
                PersonalImage.DataValue = st.img;
                LoginDTO stInfo = lgnB.Get_StInfo(Session[sessionNames.userID_StudentOstad].ToString());
                stName.InnerText = stInfo.Name + " " + stInfo.LastName;
            }


            if (Session[sessionNames.appID_StudentOstad].ToString() == "5")
            {
                a_card.Visible = true;
            }
            if (Session[sessionNames.appID_StudentOstad].ToString() == "4")
            {
                a_Edit.Visible = true;
            }
            if (Session[sessionNames.appID_StudentOstad].ToString() == "3")
            {
                a_eshteghal.Visible = true;
                a_Vaziat.Visible    = true;
            }
            if (Session[sessionNames.appID_StudentOstad].ToString() == "12")
            {
                a_tasvieh.Visible = true;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session[sessionNames.userID_StudentOstad] == null)
            {
                Response.Redirect("~/CommonUI/login.aspx");
            }

            if (Session[sessionNames.userID_StudentOstad] != null)
            {
                Label1.Text = Session[sessionNames.userID_StudentOstad].ToString();
                if (!IsPostBack)
                {
                    LoginBusiness lgnB = new LoginBusiness();
                    StuImg        st   = lgnB.User_Img(Label1.Text);
                    PersonalImg.DataValue = st.img;
                    LoginDTO stInfo = lgnB.Get_StInfo(Label1.Text);
                    stName.InnerText     = stInfo.Name;
                    stLastName.InnerText = stInfo.LastName;
                    stField.InnerText    = stInfo.StReshte;
                    Reports rpt = new Reports();
                    List <ReportDownloadReqDTO> counter = new List <ReportDownloadReqDTO>();
                    int sum = 0;
                    counter = rpt.Get_SelectedAsset_NotPay(Label1.Text);
                    ShoppingCounter.InnerText = counter.Count.ToString();
                    grdShopping.DataSource    = counter;
                    grdShopping.DataBind();
                    DownloadRequestBusiness dnlB     = new DownloadRequestBusiness();
                    List <AssetDTO>         assetlst = new List <AssetDTO>();
                    assetlst = dnlB.GetValidAssets(Label1.Text);
                    if (assetlst.Count > 0)
                    {
                        dnlNav.Visible = true;
                    }
                    if (grdShopping.MasterTableView.Items.Count > 0)
                    {
                        Paybtn.Visible = true;
                    }
                    foreach (GridDataItem item in grdShopping.MasterTableView.Items)
                    {
                        if (grdShopping.Columns[2].UniqueName == "SumPrice")
                        {
                            sum += int.Parse(item["SumPrice"].Text.Replace(",", ""));
                        }
                    }
                    Session["Fee"] = sum.ToString();
                }
                Session[sessionNames.userID_StudentOstad] = Label1.Text;
            }
            else
            {
                Response.Redirect("~/CommonUI/login.aspx", false);
            }
        }
        public StuImg User_Img(string stcode)
        {
            DataTable dt = new DataTable();

            dt = LoginDAO.User_Img(stcode);
            StuImg st = new StuImg();

            if (dt.Rows.Count > 0)
            {
                st.img = (byte[])dt.Rows[0]["stu_pic"];
            }
            else
            {
                st.img = null;
            }
            return(st);
        }
Example #5
0
        protected void Page_init(object sender, EventArgs e)
        {
            if (Session[sessionNames.userID_StudentOstad] == null)
            {
                Response.Redirect("~/CommonUI/login.aspx");
            }
            else
            {
                if (!IsPostBack)
                {
                    LoginBusiness lgnB = new LoginBusiness();
                    StuImg        st   = lgnB.User_Img(Session[sessionNames.userID_StudentOstad].ToString());
                    PersonalImage.DataValue = st.img;
                    LoginDTO stInfo = lgnB.Get_StInfo(Session[sessionNames.userID_StudentOstad].ToString());
                    stName.InnerText = stInfo.Name + " " + stInfo.LastName;
                }
                //برای زمانی که از رزرواسیون به طور مستقیم می یاد


                if (Session["ComeFromRes"] != null && Session["ComeFromRes"].ToString() == "ok")
                {
                    Session[sessionNames.appID_StudentOstad] = "4";
                    Session["ComeFromRes"] = "no";
                }

                if (Session[sessionNames.appID_StudentOstad].ToString() == "5")
                {
                    a_card.Visible = true;
                }
                if (Session[sessionNames.appID_StudentOstad].ToString() == "4")
                {
                    a_Edit.Visible = true;
                }
                if (Session[sessionNames.appID_StudentOstad].ToString() == "3")
                {
                    a_eshteghal.Visible = true;
                    a_Vaziat.Visible    = true;
                }
                if (Session[sessionNames.appID_StudentOstad].ToString() == "12")
                {
                    a_tasvieh.Visible = true;
                }
            }
        }
        protected void Page_Init(object sender, EventArgs e)
        {
            if (Session[sessionNames.userID_StudentOstad] == null)
            {
                Response.Redirect("~/CommonUI/login.aspx");
            }
            else
            {
                Session["CountUnRead"]   = null;
                Session["ContactUnread"] = null;
                LoginBusiness         logBusiness = new LoginBusiness();
                System.Data.DataTable dt          = new System.Data.DataTable();
                string userId = Session[sessionNames.userID_StudentOstad].ToString();
                user.Text = userId;
                //if (Request.QueryString["Flag_Grp"] != null )
                //{
                MessageJs.DeleteUnreadStudent(userId, Request.QueryString["Flag_Grp"] != null? Request.QueryString["Flag_Grp"]: "True",
                                              Request.QueryString["Flag_Grp"] != null && Request.QueryString["Flag_Grp"].Trim() != "True" && Request.QueryString["IdGrpOrPerson"] != null
                    ? Request.QueryString["IdGrpOrPerson"] :"-1");
                // }
                if (!IsPostBack)
                {
                    StuImg st = logBusiness.User_Img(Session[sessionNames.userID_StudentOstad].ToString());
                    PersonalImage.DataValue = st.img;
                    LoginDTO stInfo = logBusiness.Get_StInfo(Session[sessionNames.userID_StudentOstad].ToString());
                    stName.InnerText = stInfo.Name + " " + stInfo.LastName;


                    DataTable dtCountUnread;
                    DataTable dtUnReadContact;
                    dtCountUnread = MsgUnReadStudentBuisnes.GetUnReadMsgCountStudent(userId);

                    if (dtCountUnread != null && dtCountUnread.Rows.Count > 0)
                    {
                        Session["CountUnRead"] = dtCountUnread.Rows[0]["CountUnRead"].ToString();
                        dtUnReadContact        = MsgUnReadStudentBuisnes.GetUnReadMsgStudent(userId);
                        Session.Add("ContactUnread", dtUnReadContact);
                    }
                }
            }
        }