Beispiel #1
0
        protected void GVInbox_OnRebind(object sender, EventArgs e)
        {
            CustomProfile profile      = CustomProfile.GetProfile();
            iInboxClient  InboxService = new iInboxClient();

            try
            {
                var SelectedValue = hndLinkValue.Value;
                if (profile.Personal.UserType == "User")
                {
                    if (SelectedValue == "")
                    {
                        GVInbox.DataSource = InboxService.GetUserInbox(profile.Personal.UserID, profile.DBConnection._constr);
                    }
                    else
                    {
                        GVInbox.DataSource = InboxService.GetUserInboxWhere(profile.Personal.UserID, SelectedValue, profile.DBConnection._constr);
                    }
                }
                else
                {
                    if (SelectedValue == "")
                    {
                        GVInbox.DataSource = InboxService.GetInbox(profile.Personal.UserID, profile.DBConnection._constr);
                    }
                    else
                    {
                        GVInbox.DataSource = InboxService.GetInboxWhere(profile.Personal.UserID, SelectedValue, profile.DBConnection._constr);
                    }
                }
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "inbox", "GVInbox_OnRebind");
            }
            finally
            {
                InboxService.Close();
            }
            GVInbox.DataBind();
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CustomProfile profile      = CustomProfile.GetProfile();
            iInboxClient  InboxService = new iInboxClient();

            if (Session["Lang"] == "")
            {
                Session["Lang"] = Request.UserLanguages[0];
            }
            loadstring();



            if (hndLinkValue.Value == "")
            {
                hndLinkValue.Value = "All";
            }

            if (profile.Personal.UserType == "Driver")
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "showAlert('You are not allow to access web system...!!!','Error','../Login/Login.aspx')", true);
            }
            else
            {
                //GVInbox.DataSource = "";
                //GVInbox.DataBind();

                DataSet dsInbox = new DataSet();
                if (profile.Personal.UserType == "User")
                {
                    dsInbox = InboxService.GetUserInbox(profile.Personal.UserID, profile.DBConnection._constr);
                    if (dsInbox.Tables[0].Rows.Count > 0)
                    {
                        GVInbox.DataSource = dsInbox;
                    }
                }
                else
                {
                    dsInbox = InboxService.GetInbox(profile.Personal.UserID, profile.DBConnection._constr);
                    if (dsInbox.Tables[0].Rows.Count > 0)
                    {
                        GVInbox.DataSource = dsInbox;
                    }
                }

                //GVInboxPOR.DataSource = InboxService.GetInboxDetailBySiteUserID(profile.Personal.UserID, hndLinkValue.Value, profile.DBConnection._constr).ToList();
                GVInbox.DataBind();

                //if (ShowMsg == 0)
                //{
                long Days = CheckPasswordAge();
                if (Days > 14)
                {
                }
                else if (Days < 14 && Days > 0)
                {
                    string msg = "Your Password Will Be Expired Within " + Days + " Days. Please Change Your Password.";
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "showAlert('" + msg + "','Error','#')", true);
                }
                else if (Days <= 0)
                {
                    //iUserCreationClient userClient = new iUserCreationClient();
                    //long UserID = profile.Personal.UserID;
                    //string UserName = userClient.GetUserNameByID(UserID, profile.DBConnection._constr);
                    //DataSet ds = new DataSet();
                    //byte lockunlock = 1;
                    //userClient.updatelockunlock(UserName, lockunlock, profile.DBConnection._constr);
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "showAlert('Your Password Is Expired. Please Change The Password.','Error','../Login/ChangeLockedPassword.aspx')", true);
                }
                //    ShowMsg = 1;
                //}
            }
        }