Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            iInboxClient objService = new iInboxClient();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                GVInbox.DataSource = objService.GetInboxDataByUserID(profile.Personal.UserID, profile.DBConnection._constr);
                GVInbox.DataBind();
            }
            catch { }
            finally { objService.Close(); }
        }
Exemplo n.º 2
0
        public static string WMSetArchive(string SelectedRec)
        {
            CustomProfile profile      = CustomProfile.GetProfile();
            iInboxClient  InboxService = new iInboxClient();

            try
            {
                InboxService.SetArchive(SelectedRec, profile.DBConnection._constr);
            }
            catch (Exception ex)
            {
                Login.Profile.ErrorHandling(ex, "Inbox", "WMSetArchive");
            }
            finally { InboxService.Close(); }

            return("true");
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            iInboxClient InboxService = new iInboxClient();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();

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

                sqlConn = "Data Source=" + profile.DBConnection._constr[0] + ";Initial Catalog=" + profile.DBConnection._constr[1] + "; User ID=" + profile.DBConnection._constr[3] + "; Password="******";";
                ChartBind();
            }
            catch { }
            finally { InboxService.Close(); }
        }
Exemplo n.º 4
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();
        }
Exemplo n.º 5
0
        public long CheckPasswordAge()
        {
            long          DtRemaining  = 0;
            CustomProfile profile      = CustomProfile.GetProfile();
            iInboxClient  InboxService = new iInboxClient();

            try
            {
                long UserID = profile.Personal.UserID;

                DateTime PasswordChngDays = InboxService.GetLastPasswordChangeDate(UserID, profile.DBConnection._constr);

                DateTime CrntDt = DateTime.Now;

                System.TimeSpan datediff = CrntDt - PasswordChngDays;

                long DtDiff = Convert.ToInt64(datediff.Days);

                DtRemaining = 60 - DtDiff;
            }
            catch { }
            finally { }
            return(DtRemaining);
        }
Exemplo n.º 6
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;
                //}
            }
        }