protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerCalculationView + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlMoney", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlCalculation", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageCalculationView != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (!IsPostBack)
            {
                stbDeliveryDate1.Text = DateTime.Now.ToString("dd-MM-yyyy");
                if (!string.IsNullOrEmpty(Page.Request.Params["stateSave"]))
                {
                    if (!string.IsNullOrEmpty(Page.Request.Params["deliveryDate1"]))
                    {
                        stbDeliveryDate1.Text = Page.Request.Params["deliveryDate1"];
                    }

                    if (!string.IsNullOrEmpty(Page.Request.Params["deliveryDate2"]))
                    {
                        stbDeliveryDate2.Text = Page.Request.Params["deliveryDate2"];
                    }
                }
            }

            lblPage.Visible = false;
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerReportsExportTitle + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlDocuments", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlReportsExport", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageReportsExport != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (currentRole.ActionExportAllUsersInfo == 1)
            {
                pnlActionExportAllUsersInfo.Visible = true;
            }

            if (currentRole.ActionExportAllUsersProfilesInfo == 1)
            {
                pnlActionExportAllUsersProfilesInfo.Visible = true;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     OtherMethods.ActiveRightMenuStyleChanche("hlSouls", this.Page);
     OtherMethods.ActiveRightMenuStyleChanche("hlDistricts", this.Page);
     Page.Title = PagesTitles.ManagerDistrictsView + BackendHelper.TagToValue("page_title_part");
     PageAccess();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerReportsViewTitle + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlDocuments", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlReportsArchive", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageReportsView != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            var pril3ViewAccessArray = BackendHelper.TagToValue("put_3_reports_access");
            pnlPutevoi3.Visible = pril3ViewAccessArray.Split(new[] { ',' }).Any(p => p.Trim().Contains(userInSession.ID.ToString()));

            if (!IsPostBack)
            {
                CbAct.Checked      = cbNaklPlil.Checked = cbPutevoi2.Checked = cbPutevoi1.Checked = cbZP.Checked = cbRasch.Checked = true;
                cbPutevoi3.Checked = pril3ViewAccessArray.Split(new[] { ',' }).Any(p => p.Trim().Contains(userInSession.ID.ToString()));
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     OtherMethods.ActiveRightMenuStyleChanche("hlCity", this.Page);
     OtherMethods.ActiveRightMenuStyleChanche("hlSouls", this.Page);
     Page.Title = PagesTitles.ManagerCityView + BackendHelper.TagToValue("page_title_part");
     PageAccess();
     AppKey = Globals.Settings.AppServiceSecureKey;
     if (!IsPostBack)
     {
         sddlDistricts.DataSource = (from t in City.Districts
                                     select new
         {
             Key = t.Key,
             Value = t.Value.Name
         }).OrderBy(u => u.Value);
         sddlDistricts.DataTextField  = "Value";
         sddlDistricts.DataValueField = "Key";
         sddlDistricts.DataBind();
         sddlDistricts.Items.Insert(0, new ListItem("Все", ""));
         if (!String.IsNullOrEmpty(Page.Request.Params["district"]))
         {
             sddlDistricts.SelectedValue = Page.Request.Params["district"].Trim();
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            OtherMethods.ActiveRightMenuStyleChanche("hlFeedback", this.Page);
            Page.Title = PagesTitles.UserFeedbackCreate + BackendHelper.TagToValue("page_title_part");
            if (String.IsNullOrEmpty(ActivatedProfilesCount) || Convert.ToInt32(ActivatedProfilesCount) == 0)
            {
                Response.Redirect("~/usernotification/12");
            }

            if (!IsPostBack)
            {
                ddlType.DataSource     = Feedback.Types;
                ddlType.DataTextField  = "Value";
                ddlType.DataValueField = "Key";
                ddlType.DataBind();
                if (Page.Request.Params["type"] != null && Page.Request.Params["type"] == "new_category")
                {
                    ddlType.SelectedValue = "2";
                }

                ddlPriority.DataSource     = Feedback.Priorities;
                ddlPriority.DataTextField  = "Value";
                ddlPriority.DataValueField = "Key";
                ddlPriority.DataBind();
            }
        }
Beispiel #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OtherMethods.ActiveRightMenuStyleChanche("hlErrors", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlContent", this.Page);
            Page.Title = PagesTitles.ManagerErrorsLogEdit + BackendHelper.TagToValue("page_title_part");

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageErrorsLogEdit != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            var error = new ErrorsLog()
            {
                ID = Convert.ToInt32(Page.Request.Params["id"])
            };
            error.GetById();
            lblDate.Text      = error.Date.ToString();
            lblIP.Text        = error.IP;
            lblType.Text      = error.ErrorType;
            tbStackTrase.Text = error.StackTrase;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerNotificationEdit + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlNotifications", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlContent", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageNotificationsEdit != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (Page.Request.Params["id"] != null)
            {
                var note = new Notification {
                    ID = Convert.ToInt32(Page.Request.Params["id"])
                };
                note.GetById();
                if (!IsPostBack)
                {
                    if (string.IsNullOrEmpty(note.Title))
                    {
                        tbTitle.Visible  = false;
                        lblTitle.Visible = false;
                    }
                    tbTitle.Text            = note.Title;
                    tbBody.Text             = note.Description;
                    lblDescriptionMore.Text = note.DescriptionStatic;
                }
            }
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = Page.Request.Params["id"] != null ? PagesTitles.ManagerCategoryEditTitle + BackendHelper.TagToValue("page_title_part") : PagesTitles.ManagerCategoryCreateTitle + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlCategory", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlSouls", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageCategoryEdit != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (Page.Request.Params["id"] != null)
            {
                var section = new Category()
                {
                    ID = Convert.ToInt32(Page.Request.Params["id"])
                };
                section.GetById();
                if (!IsPostBack)
                {
                    tbName.Text = section.Name;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerUsersDiscount + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlUsersDiscount", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlSettings", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageUserDiscountView != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (!IsPostBack)
            {
                sddlStatus.DataSource     = Users.UserStatuses;
                sddlStatus.DataTextField  = "Value";
                sddlStatus.DataValueField = "Key";
                sddlStatus.DataBind();
                sddlStatus.Items.Insert(0, new ListItem("Все", string.Empty));

                sddlCourse.Items.Add(new ListItem("Да", "1"));
                sddlCourse.Items.Add(new ListItem("Нет", "0"));
                sddlCourse.Items.Insert(0, new ListItem("Все", string.Empty));

                if (Page.Request.Params["uid"] != null)
                {
                    stbUID.Text = Page.Request.Params["uid"];
                }
            }
        }
Beispiel #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //SmsSender.SendSmsBulkIfTicketOnStock("37789");

            Page.Title = PagesTitles.UserDefaultTitle + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlMain", this.Page);
            var userInSession = (Users)Session["userinsession"];
            var user          = new Users
            {
                ID = UserID
            };

            user.GetById();
            lblUID.Text   = user.ID.ToString();
            lblEmail.Text = user.Email;
            lblLogin.Text = user.Login;

            if (user.ManagerID != 0)
            {
                trLogistian.Visible = true;

                var userLogistian = new Users()
                {
                    ID = Convert.ToInt32(user.ManagerID)
                };
                lblLogistian.Text = userLogistian.Name + ", тел. " + userLogistian.PhoneWorkOne;
            }

            if (user.SalesManagerID != 0)
            {
                trManager.Visible = true;

                var userManager = new Users()
                {
                    ID = Convert.ToInt32(user.SalesManagerID)
                };
                lblManager.Text = userManager.Family + " " + userManager.Name + ", тел. " + userManager.PhoneWorkOne;
            }

            if (user.AllowApi == 1)
            {
                trApiKey.Visible = true;
                lblApiKey.Text   = user.ApiKey;
            }
            if (user.Discount == 0)
            {
                tdDiscount.Visible = false;
            }
            else
            {
                lblDiscount.Text = user.Discount + "%";
            }

            DeliveryOnMinskPhones = BackendHelper.TagToValue("delivery_on_minsk_phones");
            DeliveryOnMinskSkype  = BackendHelper.TagToValue("delivery_on_minsk_skype");

            //пересчитываем просмотренные новости
            //обновляем\задаем авторизационную куку с данными пользователя
            AuthenticationMethods.SetUserCookie(userInSession);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     Page.Title = PagesTitles.ManagerErrorsLogView + BackendHelper.TagToValue("page_title_part");
     OtherMethods.ActiveRightMenuStyleChanche("hlErrors", this.Page);
     OtherMethods.ActiveRightMenuStyleChanche("hlContent", this.Page);
     PageAccess();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerSendComProp + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlDocuments", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlSendComProp", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageSendComProp != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (Session["flash:now"] != null && Session["flash:now"].ToString() != String.Empty)
            {
                lblStatus.Text       = Session["flash:now"].ToString();
                Session["flash:now"] = String.Empty;
            }

            if (!IsPostBack)
            {
                var dm       = new DataManager();
                var category = dm.QueryWithReturnDataSet("SELECT * FROM `category` ORDER BY `Name` ASC");
                lvAllCategory.DataSource = category;
                lvAllCategory.DataBind();
            }
        }
Beispiel #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerBackendEdit + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlBackend", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlSettings", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageBackendEdit != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            var backend = new Backend {
                ID = Convert.ToInt32(Page.Request.Params["id"])
            };
            backend.GetById();
            if (!IsPostBack)
            {
                lblTag.Text         = backend.Tag;
                lblDescription.Text = backend.Description;
                tbValue.Text        = backend.Value;
                var changeDate = OtherMethods.DateConvert(backend.ChangeDate.ToString());
                if (!String.IsNullOrEmpty(changeDate))
                {
                    pnlChangeDate.Visible = true;
                    lblChangeDate.Text    = changeDate;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            OtherMethods.ActiveRightMenuStyleChanche("hlMain", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlAnonymousMessage", this.Page);
            Page.Title = PagesTitles.ManagerAnonymousMessage + BackendHelper.TagToValue("page_title_part");

            lblEmalList.Text = BackendHelper.TagToValue("anonymous_message_email_list");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerClientCreateTitle + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlSouls", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlClients", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageClientsCreate != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            AppKey = Globals.Settings.AppServiceSecureKey;

            if (Session["flash:now"] != null && Session["flash:now"].ToString() != string.Empty)
            {
                lblStatus.Text       = Session["flash:now"].ToString();
                Session["flash:now"] = String.Empty;
            }

            var dm = new DataManager();
            if (!IsPostBack)
            {
                var dataSetForSalesManager = dm.QueryWithReturnDataSet("select * from `users` WHERE (role = 'SalesManager') and Status = 2 ORDER BY Family ASC, Name ASC;");
                dataSetForSalesManager.Tables[0].Columns.Add("FIO", typeof(string), "Family + ' ' + Name");
                ddlSalesManager.DataSource     = dataSetForSalesManager;
                ddlSalesManager.DataTextField  = "FIO";
                ddlSalesManager.DataValueField = "ID";
                ddlSalesManager.DataBind();
                ddlSalesManager.Items.Insert(0, new ListItem("Не назначен", "0"));

                ddlStatusStady.DataSource     = Users.UserStatusesStudy;
                ddlStatusStady.DataTextField  = "Value";
                ddlStatusStady.DataValueField = "Key";
                ddlStatusStady.DataBind();

                ddlProfileType.DataSource     = UsersProfiles.ProfileType;
                ddlProfileType.DataTextField  = "Value";
                ddlProfileType.DataValueField = "Key";
                ddlProfileType.DataBind();
                ddlProfileType.Items.Remove(ddlProfileType.Items.FindByValue("1"));


                ddlCompanyType.DataSource     = UsersProfiles.CompanyType;
                ddlCompanyType.DataTextField  = "Value";
                ddlCompanyType.DataValueField = "Key";
                ddlCompanyType.DataBind();
            }


            var category = dm.QueryWithReturnDataSet("SELECT * FROM `category` ORDER BY `Name` ASC");
            lvAllCategory.DataSource = category;
            lvAllCategory.DataBind();
        }
Beispiel #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OtherMethods.ActiveRightMenuStyleChanche("hlCars", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlSouls", this.Page);
            Page.Title = Page.Request.Params["id"] != null ? PagesTitles.ManagerCarEdit + BackendHelper.TagToValue("page_title_part") : PagesTitles.ManagerCarCreate + BackendHelper.TagToValue("page_title_part");

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageCarEdit != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            BackLink = CarsHelper.BackCarLinkBuilder(Page.Request.Params["aid"], Page.Request.Params["model"], Page.Request.Params["number"], Page.Request.Params["typeid"]);

            if (!IsPostBack)
            {
                ddlType.DataSource     = Cars.CarType;
                ddlType.DataTextField  = "Value";
                ddlType.DataValueField = "Key";
                ddlType.DataBind();
            }

            if (Page.Request.Params["id"] != null)
            {
                var car = new Cars {
                    ID = Convert.ToInt32(Page.Request.Params["id"])
                };
                car.GetById();
                if (String.IsNullOrEmpty(car.Model))
                {
                    Page.Response.Redirect("~/ManagerUI/Menu/Souls/CarsView.aspx?" + BackLink);
                }
                if (!IsPostBack)
                {
                    ddlType.SelectedValue = car.TypeID.ToString();
                    tbModel.Text          = car.Model;
                    tbNumber.Text         = hfNumber.Value = car.Number;

                    tbCompanyName.Text = car.CompanyName;

                    tbFirstName.Text           = car.FirstName;
                    tbLastName.Text            = car.LastName;
                    tbThirdName.Text           = car.ThirdName;
                    tbPassportSeria.Text       = car.PassportSeria;
                    tbPassportNumber.Text      = car.PassportNumber;
                    tbPersonalNumber.Text      = car.PersonalNumber;
                    tbROVD.Text                = car.ROVD;
                    tbRegistrationAddress.Text = car.RegistrationAddress;
                    tbValidity.Text            = Convert.ToDateTime(car.Validity).ToString("dd-MM-yyyy");
                    tbBirthDay.Text            = Convert.ToDateTime(car.BirthDay).ToString("dd-MM-yyyy");
                    tbDateOfIssue.Text         = Convert.ToDateTime(car.DateOfIssue).ToString("dd-MM-yyyy");
                }
            }
        }
Beispiel #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerCarView + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlCars", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlSouls", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageCarView != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (Page.Request.Params["id"] != null)
            {
                if (!IsPostBack)
                {
                    var id  = Convert.ToInt32(Page.Request.Params["id"]);
                    var car = new Cars {
                        ID = id
                    };
                    car.GetById();
                    lblID.Text = car.ID.ToString();
                    var dm = new DataManager();
                    var driversForCarTable = dm.QueryWithReturnDataSet(String.Format("SELECT ID, FirstName, LastName, ThirdName FROM drivers WHERE CarID = {0}", id));
                    foreach (DataRow driver in driversForCarTable.Tables[0].Rows)
                    {
                        lblDrivers.Text += String.Format("<a href='DriversEdit.aspx?id={3}'>{0} {1}.{2}.</a>&nbsp; &nbsp;",
                                                         driver["FirstName"],
                                                         driver["LastName"].ToString().Remove(1, driver["LastName"].ToString().Length - 1),
                                                         driver["ThirdName"].ToString().Remove(1, driver["ThirdName"].ToString().Length - 1),
                                                         driver["ID"]);
                    }

                    lblType.Text   = CarsHelper.CarTypeToFullString(Convert.ToInt32(car.TypeID));
                    hfTypeID.Value = car.TypeID.ToString();
                    lblModel.Text  = car.Model;
                    lblNumber.Text = car.Number;

                    lblCompanyName.Text = car.CompanyName;

                    lblFirstName.Text           = car.FirstName;
                    lblLastName.Text            = car.LastName;
                    lblThirdName.Text           = car.ThirdName;
                    lblPassport.Text            = car.PassportSeria + car.PassportNumber;
                    lblPersonalNumber.Text      = car.PersonalNumber;
                    lblROVD.Text                = car.ROVD;
                    lblRegistrationAddress.Text = car.RegistrationAddress;
                    lblValidity.Text            = Convert.ToDateTime(car.Validity).ToString("dd-MM-yyyy");
                    lblBirthDay.Text            = Convert.ToDateTime(car.BirthDay).ToString("dd-MM-yyyy");
                    lblDateOfIssue.Text         = Convert.ToDateTime(car.DateOfIssue).ToString("dd-MM-yyyy");
                }
            }
        }
Beispiel #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = Page.Request.Params["id"] != null ? PagesTitles.ManagerTitlesEditTitle + BackendHelper.TagToValue("page_title_part") : PagesTitles.ManagerTitlesCreateTitle + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlTitles", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlSouls", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageTitlesEdit != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (!IsPostBack)
            {
                var category = new Category();
                var ds       = category.GetAllItems("Name", "ASC", null);
                ddlCategory.DataSource     = ds;
                ddlCategory.DataTextField  = "Name";
                ddlCategory.DataValueField = "ID";
                ddlCategory.DataBind();
                ddlCategory.Items.Add(new ListItem("Не назначена", "0"));
            }

            btnDelete.Visible = CanDelete();

            if (Page.Request.Params["id"] != null)
            {
                var title = new Titles()
                {
                    ID = Convert.ToInt32(Page.Request.Params["id"])
                };
                title.GetById();
                if (!IsPostBack)
                {
                    tbName.Text = title.Name;
                    tbMarginCoefficient.Text         = title.MarginCoefficient.ToString();
                    tbWeightMin.Text                 = title.WeightMin.ToString();
                    tbWeightMax.Text                 = title.WeightMax.ToString();
                    tbAdditiveCostWithoutAkciza.Text = title.AdditiveCostWithoutAkciza.ToString();
                    if (title.Additive == 1)
                    {
                        cbAdditive.Checked = true;
                    }
                    if (title.CanBeWithoutAkciza == 1)
                    {
                        cbCanBeWithoutAkciza.Checked = true;
                    }

                    ddlCategory.SelectedValue = title.CategoryID.ToString();
                }
            }
        }
Beispiel #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerNewIssuanceViewTitle + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlIssuance", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlNewIssuanceView", this.Page);
            if (Session["flash:now"] != null && Session["flash:now"].ToString() != String.Empty)
            {
                lblStatus.Text       = Session["flash:now"].ToString();
                Session["flash:now"] = String.Empty;
            }

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageNewIssuanceView != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            var dm = new DataManager();

            var dataSet4 = dm.QueryWithReturnDataSet(String.Format("SELECT DISTINCT T.UserID FROM tickets T WHERE " + avaibleStatusesQuery + " ORDER BY T.UserID ASC"));
            sddlUID.DataSource     = dataSet4;
            sddlUID.DataTextField  = "UserID";
            sddlUID.DataValueField = "UserID";
            sddlUID.DataBind();
            sddlUID.Items.Insert(0, new ListItem("Все", string.Empty));

            var userIdExist = false;
            foreach (ListItem item in sddlUID.Items)
            {
                if (item.Value == Page.Request["ctl00$MainContent$sddlUID"] && userIdExist == false)
                {
                    userIdExist = true;
                }
            }
            if (userIdExist)
            {
                sddlUID.SelectedValue = Page.Request["ctl00$MainContent$sddlUID"];
            }
            //формируем форму поиска по водителю КОНЕЦ

            if (!IsPostBack)
            {
                sddlProfileType.DataSource     = DAL.DataBaseObjects.Tickets.ProfileType;
                sddlProfileType.DataTextField  = "Value";
                sddlProfileType.DataValueField = "Key";
                sddlProfileType.DataBind();
            }

            lblPage.Visible          = false;
            pnlSearschResult.Visible = false; //pnlActions.Visible =
        }
Beispiel #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerDriverViewTitle + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlDrivers", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlSouls", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageDriverView != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (Page.Request.Params["id"] != null)
            {
                if (!IsPostBack)
                {
                    var driver = new Drivers {
                        ID = Convert.ToInt32(Page.Request.Params["id"])
                    };
                    driver.GetById();
                    lblID.Text        = driver.ID.ToString();
                    lblStatus.Text    = DriversHelper.DriverStatusToText(Convert.ToInt32(driver.StatusID));
                    lblCar.Text       = CarsHelper.CarIdToModelName(driver.CarID.ToString());
                    hlCar.NavigateUrl = "~/ManagerUI/CarView.aspx?id=" + driver.CarID;

                    lblFIO.Text                = String.Format("{0} {1} {2}", driver.FirstName, driver.LastName, driver.ThirdName);
                    lblPhoneOne.Text           = driver.PhoneOne;
                    lblPhoneTwo.Text           = driver.PhoneTwo;
                    lblHomePhone.Text          = driver.HomePhone;
                    lblHomeAddress.Text        = driver.HomeAddress;
                    lblBirthDay.Text           = Convert.ToDateTime(driver.BirthDay).ToString("dd-MM-yyyy");
                    lblContactPersonFIO.Text   = driver.ContactPersonFIO;
                    lblContactPersonPhone.Text = driver.ContactPersonPhone;

                    lblPassportData.Text        = String.Format("{0}{1}", driver.PassportSeria, driver.PassportNumber);
                    lblPersonalNumber.Text      = driver.PersonalNumber;
                    lblROVD.Text                = driver.ROVD;
                    lblDateOfIssue.Text         = Convert.ToDateTime(driver.DateOfIssue).ToString("dd-MM-yyyy");
                    lblValidity.Text            = Convert.ToDateTime(driver.Validity).ToString("dd-MM-yyyy");
                    lblRegistrationAddress.Text = driver.RegistrationAddress;

                    lblDriverPassport.Text            = driver.DriverPassport;
                    lblDriverPassportDateOfIssue.Text = Convert.ToDateTime(driver.DriverPassportDateOfIssue).ToString("dd-MM-yyyy");
                    lblDriverPassportValidity.Text    = Convert.ToDateTime(driver.DriverPassportValidity).ToString("dd-MM-yyyy");
                    lblMedPolisDateOfIssue.Text       = Convert.ToDateTime(driver.MedPolisDateOfIssue).ToString("dd-MM-yyyy");
                    lblMedPolisValidity.Text          = Convert.ToDateTime(driver.MedPolisValidity).ToString("dd-MM-yyyy");
                }
            }
        }
Beispiel #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OtherMethods.ActiveRightMenuStyleChanche("hlFAQ", this.Page);
            var page = new Pages
            {
                ID = 6
            };

            page.GetById();
            lblJob.Text = page.Content;
            Page.Title  = page.PageName + BackendHelper.TagToValue("page_title_part");
        }
Beispiel #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OtherMethods.ActiveRightMenuStyleChanche("hlSouls", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlProviders", this.Page);
            Page.Title = Page.Request.Params["id"] != null ? PagesTitles.ManagerProviderEdit + BackendHelper.TagToValue("page_title_part") : PagesTitles.ManagerProviderCreate + BackendHelper.TagToValue("page_title_part");
            AppKey     = Globals.Settings.AppServiceSecureKey;

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageDistrictEdit != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (!IsPostBack)
            {
                ddlNamePrefix.DataSource     = Providers.NamePrefixes;
                ddlNamePrefix.DataTextField  = "Value";
                ddlNamePrefix.DataValueField = "Key";
                ddlNamePrefix.DataBind();
            }

            if (Page.Request.Params["id"] != null)
            {
                var provider = new Providers
                {
                    ID = Convert.ToInt32(Page.Request.Params["id"])
                };
                provider.GetById();
                if (!IsPostBack)
                {
                    ddlNamePrefix.SelectedValue = provider.NamePrefix;
                    tbName.Text            = provider.Name;
                    tbContactFIO.Text      = provider.ContactFIO;
                    tbContactPhone.Text    = provider.ContactPhone;
                    tbTypesOfProducts.Text = provider.TypesOfProducts;
                    tbAddress.Text         = provider.Address;
                    tbNote.Text            = provider.Note;
                    var allCity = Application["CityList"] as List <City>;
                    if (allCity != null)
                    {
                        tbCity.Text =
                            CityHelper.CityIDToAutocompleteString(allCity.FirstOrDefault(u => u.ID == provider.CityID));
                        hfCityID.Value = provider.CityID.ToString();
                    }
                }
            }
        }
Beispiel #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OtherMethods.ActiveRightMenuStyleChanche("hlNewsFeed", this.Page);
            Page.Title = PagesTitles.ManagerNewsFromFeedView + BackendHelper.TagToValue("page_title_part");

            if (Request.Params["title"] != null)
            {
                var userInSession = (Users)Session["userinsession"];
                var news          = new News {
                    TitleUrl = Request.Params["title"].ToString()
                };
                news.GetByTitleUrl();
                if (!IsPostBack && news.NewsTypeID == 2)
                {
                    lblTitle.Text      = news.Title;
                    lblBody.InnerHtml  = news.Body;
                    lblCreateDate.Text = news.CreateDate.ToString();

                    //если новость просмотрел клиент - записываем ему просмотр и обновляем список непрочтенных новостей
                    if (userInSession.Role == Users.Roles.User.ToString())
                    {
                        var dm = new DataManager();
                        var isUserViewCount = Convert.ToInt32(
                            dm.QueryWithReturnDataSet(
                                String.Format("select count(*) from `usertonewsview` WHERE `UserID` = {0} AND `NewsID` = {1};", userInSession.ID, news.ID)
                                ).Tables[0].Rows[0][0].ToString()
                            );
                        //записываем данные о инфе, что усер просмотрел новость
                        if (isUserViewCount == 0)
                        {
                            var userView = new UserToNewsView {
                                UserID = userInSession.ID, NewsID = news.ID
                            };
                            userView.Create();
                        }
                        //пересчитываем просмотренные новости
                        //обновляем\задаем авторизационную куку с данными пользователя
                        AuthenticationMethods.SetUserCookie(userInSession);
                    }
                }
                else
                {
                    //Response.Redirect("~/UserUI/NewsFeedView.aspx");
                }
            }
            else
            {
                //Response.Redirect("~/UserUI/NewsFeedView.aspx");
            }
        }
Beispiel #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.UserProfileViewTitle + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlProfile", this.Page);

            var id      = Page.Request.Params["id"];
            var profile = new UsersProfiles {
                ID = Convert.ToInt32(id)
            };

            profile.GetById();
            if (!IsPostBack)
            {
                lblFirstName.Text   = profile.FirstName;
                lblLastName.Text    = profile.LastName;
                lblThirdName.Text   = profile.ThirdName;
                lblDirectorFIO.Text = String.Format("{0} {1} {2}", profile.FirstName, profile.LastName,
                                                    profile.ThirdName);
                lblDirectorPhone.Text       = profile.DirectorPhoneNumber;
                lblContactPersonFIO.Text    = profile.ContactPersonFIO;
                lblContactPersonPhones.Text = profile.ContactPhoneNumbers;
                lblPassportData.Text        = profile.PassportData;
                lblPassportNumber.Text      = profile.PassportNumber;
                lblAddress.Text             = profile.Address;
                lblCompanuName.Text         = profile.CompanyName;
                lblCompanyAddress.Text      = profile.CompanyAddress;
                lblBankName.Text            = profile.BankName;
                lblBankAddress.Text         = profile.BankCode;
                lblBankCode.Text            = profile.BankCode;
                lblRS.Text     = profile.RasShet;
                lblUNP.Text    = profile.UNP;
                lblStatus.Text = UsersProfilesHelper.UserProfileStatusToText(Convert.ToInt32(profile.StatusID));
                if (!String.IsNullOrEmpty(profile.RejectBlockedMessage) && profile.StatusID != 1 && profile.StatusID != 0)
                {
                    pnlStatusDescription.Visible = true;
                    lblStatusDescription.Text    = profile.RejectBlockedMessage;
                }
            }
            if (profile.TypeID == 1)
            {
                pnlUr.Visible  = false;
                pnlFiz.Visible = true;
            }
            else
            {
                pnlUr.Visible  = true;
                pnlFiz.Visible = false;
            }
        }
Beispiel #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerRolesView + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlSettings", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlRoles", this.Page);

            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());

            if (currentRole.PageRolesView != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerIssuanceListViewTitle.Replace("{0}", Page.Request.Params["id"]) + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlIssuance", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlIssuanceListsView", this.Page);

            #region Блок доступа к странице
            var userInSession = (Users)Session["userinsession"];
            var rolesList     = Application["RolesList"] as List <Roles>;
            var currentRole   = (Roles)rolesList.SingleOrDefault(u => u.Name.ToLower() == userInSession.Role.ToLower());
            if (currentRole.PageIssuanceListView != 1)
            {
                Response.Redirect("~/Error.aspx?id=1");
            }
            #endregion

            if (currentRole.ActionIssuanceListDelete != 1)
            {
                btnDelete.Visible = false;
            }

            if (!String.IsNullOrEmpty(Page.Request.Params["id"]))
            {
                var issuanceList = new IssuanceLists()
                {
                    ID = Convert.ToInt32(Page.Request.Params["id"])
                };
                issuanceList.GetById();
                if (issuanceList.IssuanceListsStatusID == 3 || issuanceList.IssuanceListsStatusID == 1)
                {
                    btnReopen.Visible = false;
                    btnClose.Visible  = true;
                }
                else
                {
                    btnReopen.Visible = true;
                    btnClose.Visible  = false;
                }
                var user = UsersHelper.UserIDToFullName(issuanceList.UserID.ToString());
                lblListInfo.Text = String.Format("# {0}, {1}, рассчет: {2}", issuanceList.ID, user,
                                                 OtherMethods.DateConvert(issuanceList.IssuanceDate.ToString()));
            }
            else
            {
                pnlSearschResult.Visible = pnlResultPanel.Visible = btnAction.Visible = false;
                lblPage.Visible          = false;
            }
        }
Beispiel #28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     OtherMethods.ActiveRightMenuStyleChanche("hlTracks", this.Page);
     OtherMethods.ActiveRightMenuStyleChanche("hlSouls", this.Page);
     if (Page.Request.Params["id"] != null)
     {
         var route = new Routes {
             ID = Convert.ToInt32(Page.Request.Params["id"])
         };
         route.GetById();
         if (!IsPostBack)
         {
             tbName.Text = route.Name;
         }
     }
 }
Beispiel #29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = PagesTitles.ManagerDriversView + BackendHelper.TagToValue("page_title_part");
            OtherMethods.ActiveRightMenuStyleChanche("hlProviders", this.Page);
            OtherMethods.ActiveRightMenuStyleChanche("hlSouls", this.Page);
            PageAccess();

            if (!IsPostBack)
            {
                sddlNamePrefix.DataSource     = Providers.NamePrefixes;
                sddlNamePrefix.DataTextField  = "Value";
                sddlNamePrefix.DataValueField = "Key";
                sddlNamePrefix.DataBind();
                sddlNamePrefix.Items.Insert(0, new ListItem("Все", string.Empty));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            OtherMethods.ActiveRightMenuStyleChanche("hlFeedback", this.Page);
            Page.Title = PagesTitles.UserFeedbacksView + BackendHelper.TagToValue("page_title_part");
            if (String.IsNullOrEmpty(ActivatedProfilesCount) || Convert.ToInt32(ActivatedProfilesCount) == 0)
            {
                Response.Redirect("~/usernotification/12");
            }

            //закрываем старые обращения, которым с последнего коммента или создания (при отсутствии коммента) 21 день
            var dm = new DataManager();

            dm.QueryWithoutReturnData(null,
                                      "UPDATE `feedback` F SET F.`StatusID` = 1 WHERE (SELECT DATEDIFF(NOW(), F.`CreateDate`) AS DiffDate) > 21 AND F.`ChangeDate` IS NULL AND F.`StatusID` <> 1;" +
                                      "UPDATE `feedback` F SET F.`StatusID` = 1 WHERE (SELECT DATEDIFF(NOW(),(SELECT FC.`CreateDate` FROM `feedbackcomments` FC WHERE FC.`FeedbackID` = F.`ID` ORDER BY ID DESC LIMIT 1)) AS DiffDate) > 21 AND F.`StatusID` <> 1;");
        }