コード例 #1
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            SiteId = ((LeadForceBasePage)Page).SiteId;

            ((Site)Page.Master).HideInaccessibleTabs(ref RadTabStrip1, ref RadMultiPage1);

            access = Access.Check();
            if (!access.Write)
            {
                lbtnSave.Visible = false;
            }

            var companyId = Page.RouteData.Values["id"] as string;

            hlCancel.NavigateUrl = UrlsData.AP_Companies();

            if (!string.IsNullOrEmpty(companyId))
            {
                CompanyId = Guid.Parse(companyId);
            }

            ucTaskList.CompanyId = CompanyId;
            ucTaskList.SiteId    = SiteId;

            ucContactList.CompanyId = CompanyId;
            ucContactList.SiteId    = SiteId;

            tagsCompany.ObjectID = CompanyId;

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
コード例 #2
0
        /// <summary>
        /// Handles the AjaxRequest event of the radAjaxManager control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.AjaxRequestEventArgs"/> instance containing the event data.</param>
        protected void radAjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "AddCompany")
            {
                if (Session["UpdatedContactId"] != null && Session["CompanyTitle"] != null)
                {
                    var company = new tbl_Company
                    {
                        ID        = Guid.NewGuid(),
                        CreatedAt = DateTime.Now,
                        SiteID    = CurrentUser.Instance.SiteID,
                        Name      = Session["CompanyTitle"].ToString(),
                        StatusID  = _dataManager.Status.SelectDefault(CurrentUser.Instance.SiteID).ID
                    };
                    _dataManager.Company.Add(company);

                    var contact = _dataManager.Contact.SelectById(CurrentUser.Instance.SiteID, Guid.Parse(Session["UpdatedContactId"].ToString()));
                    contact.CompanyID = company.ID;
                    _dataManager.Contact.Update(contact);

                    Session["CompanyTitle"]     = null;
                    Session["UpdatedContactId"] = null;

                    Response.Redirect(UrlsData.AP_Company(company.ID));
                }
            }

            if (e.Argument == "CancelAddCompany")
            {
                Session["CompanyTitle"]     = null;
                Session["UpdatedContactId"] = null;
                Response.Redirect(UrlsData.AP_Contacts());
            }
        }
コード例 #3
0
ファイル: Tasks.aspx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            var user        = DataManager.User.SelectById(CurrentUser.Instance.ID);
            var accessCheck = Access.Check(user, "Tasks");

            if (!accessCheck.Read)
            {
                Response.Redirect(UrlsData.LFP_AccessDenied(PortalSettingsId));
            }

            Title = "Задачи";

            rScheduler.Culture = new CultureInfo("ru-RU");

            rScheduler.FirstDayOfWeek = DayOfWeek.Monday;
            rScheduler.LastDayOfWeek  = DayOfWeek.Sunday;

            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucTaskFilter, gridTasks);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucTaskFilter, rScheduler);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rScheduler, ucTaskFilter);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rScheduler, gridTasks);

            ucTaskFilter.SiteId         = SiteId;
            ucTaskFilter.FilterChanged += ucTaskFilter_FilterChanged;

            gridTasks.SiteID = SiteId;
            gridTasks.Actions.Add(new GridAction {
                Text = "Карточка задачи", NavigateUrl = "~/" + PortalSettingsId + "/Main/Tasks/Edit/{0}", ImageUrl = "~/App_Themes/Default/images/icoView.png"
            });
        }
コード例 #4
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            var menu = DataManager.Menu.SelectByAccessProfileID(AccessProfile.ID).FirstOrDefault(o => o.ModuleID.HasValue && o.tbl_Module.Name == "Contacts");

            if (menu != null)
            {
                var tab = string.IsNullOrEmpty(menu.TabName) && menu.ParentID.HasValue ? DataManager.Menu.SelectByID(menu.ParentID.Value).TabName : menu.TabName;
                ContactsUrl = ResolveUrl(string.Format("~/{0}/{1}/List", tab, menu.tbl_Module.Name));
            }
            else
            {
                ContactsUrl = UrlsData.AP_Contacts("Monitoring");
            }

            var advertisingPlatforms = DataManager.StatisticData.VisitorSourceNewAnonymousAdvertisingPlatform.OrderByDescending(o => o.Value.DbValue).Take(3);
            var sb = new StringBuilder();

            foreach (var advertisingPlatform in advertisingPlatforms)
            {
                if (advertisingPlatform.Value.Value == 0)
                {
                    continue;
                }

                var advPlatform = DataManager.AdvertisingPlatform.SelectById(Guid.Parse(advertisingPlatform.Key.Split('_')[1]));
                sb.Append(string.Format("<li><a href=\"{0}?f={1}\">{2} {3}</a></li>", ContactsUrl, advPlatform.ID, advPlatform.Title, advertisingPlatform.Value.HtmlValue));
            }

            lrlVisitorSourceNewAnonymousAdvertisingPlatform.Text = sb.ToString();
        }
コード例 #5
0
 /// <summary>
 /// Handles the OnLogoutClick event of the MainMenu control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void MainMenu_OnLogoutClick(object sender, EventArgs e)
 {
     HttpContext.Current.Session.Remove("siteID");
     CurrentUser.UserInstanceFlush();
     FormsAuthentication.SignOut();
     Response.Redirect(UrlsData.AP_Home());
 }
コード例 #6
0
ファイル: SiteDomain.aspx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Настройки домена - LeadForce";

            if (Page.RouteData.Values["id"] != null)
            {
                _siteDomainId = Guid.Parse(Page.RouteData.Values["id"] as string);
            }

            if (Page.RouteData.Values["siteId"] != null)
            {
                _siteId = Guid.Parse(Page.RouteData.Values["siteId"] as string);
            }

            if (Request.Url.ToString().ToLower().Contains("sites"))
            {
                hlCancel.NavigateUrl = UrlsData.AP_Sites();
            }
            else
            {
                hlCancel.NavigateUrl = UrlsData.AP_Settings();
            }

            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(lbtnSave, ucNotificationMessage);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(lbtnSave, lrlSiteDomainStatus, null, UpdatePanelRenderMode.Inline);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucCheckSite, lrlSiteDomainStatus);

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
コード例 #7
0
ファイル: UserEdit.aspx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Пользователи - LeadForce";

            if (Page.RouteData.Values["id"] != null)
            {
                _userId = Guid.Parse(Page.RouteData.Values["id"] as string);
            }

            hlCancel.NavigateUrl = UrlsData.AP_Users();

            tagsUser.ObjectID = _userId;

            if ((AccessLevel)CurrentUser.Instance.AccessLevelID == AccessLevel.SystemAdministrator)
            {
                dcbSite.SelectedIndexChanged += dcbSite_SelectedIndexChanged;
                dcbSite.AutoPostBack          = true;
                RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(dcbSite, rcbContact, null, UpdatePanelRenderMode.Inline);
            }

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
コード例 #8
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "База знаний - LeadForce";

            if (Page.RouteData.Values["categoryId"] != null)
            {
                CategoryId = Guid.Parse(Page.RouteData.Values["categoryId"] as string);
            }

            gridKnowledgeBase.AddNavigateUrl = UrlsData.AP_KnowledgeBaseAdd();
            gridKnowledgeBase.Actions.Add(new GridAction {
                Text = "Карточка публикации", NavigateUrl = string.Format("~/{0}/KnowledgeBase/Edit/{{0}}", CurrentTab), ImageUrl = "~/App_Themes/Default/images/icoView.png"
            });
            gridKnowledgeBase.SiteID = SiteId;

            gridKnowledgeBase.Where = new List <GridWhere>();
            gridKnowledgeBase.Where.Add(new GridWhere {
                Column = "tbl_PublicationType.PublicationKindID", Value = ((int)PublicationKind.KnowledgeBase).ToString()
            });

            if (CategoryId.HasValue && CategoryId != Guid.Empty)
            {
                gridKnowledgeBase.Where.Add(new GridWhere {
                    Column = "PublicationCategoryID", Value = CategoryId.ToString()
                });
            }
        }
コード例 #9
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Требования - LeadForce";

            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(chxByResponsible, gridRequirements);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(chxCurrentRequirements, gridRequirements);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucResponsible, gridRequirements);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(chxToPay, gridRequirements);

            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(chxByResponsible, rtlRequirements);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(chxCurrentRequirements, rtlRequirements);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucResponsible, rtlRequirements);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(chxToPay, rtlRequirements);

            gridRequirements.AddNavigateUrl = UrlsData.AP_RequirementAdd();
            gridRequirements.Actions.Add(new GridAction {
                Text = "Карточка требования", NavigateUrl = string.Format("~/{0}/Requirements/Edit/{{0}}", CurrentTab), ImageUrl = "~/App_Themes/Default/images/icoView.png"
            });
            gridRequirements.SiteID = SiteId;

            dcbCompany.SiteID = SiteId;

            if (!Page.IsPostBack)
            {
                InitFilter();
                rdpStartDate.SelectedDate = DateTimeHelper.GetFirstDayOfWeek(DateTime.Now);
                rdpEndDate.SelectedDate   = DateTime.Now;
            }
        }
コード例 #10
0
ファイル: SiteEdit.aspx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CurrentUser.Instance.AccessLevelID != (int)AccessLevel.SystemAdministrator)
            {
                Response.Redirect(UrlsData.AP_Home());
            }

            Title = "Сайты - LeadForce";

            if (Page.RouteData.Values["id"] != null)
            {
                _siteId = Guid.Parse(Page.RouteData.Values["id"] as string);
            }

            hlCancel.NavigateUrl = UrlsData.AP_Sites();

            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rcbAccessProfile, plAccessBlock, null, UpdatePanelRenderMode.Inline);

            tagsSite.ObjectID = _siteId;

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
コード例 #11
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Мероприятие - LeadForce";

            access = Access.Check();
            if (!access.Write)
            {
                lbtnSave.Visible = false;
            }

            if (Page.RouteData.Values["id"] != null)
            {
                _massWorkflowId = Guid.Parse(Page.RouteData.Values["id"] as string);
            }

            hlCancel.NavigateUrl = UrlsData.AP_MassWorkflows();

            gridContacts.SiteID = SiteId;

            if (!Page.IsPostBack)
            {
                BindData();
            }

            radAjaxManager = RadAjaxManager.GetCurrent(Page);
            radAjaxManager.AjaxSettings.AddAjaxSetting(ucSelectContacts, gridContacts);
            radAjaxManager.AjaxSettings.AddAjaxSetting(radAjaxManager, ucChart1);
            radAjaxManager.AjaxSettings.AddAjaxSetting(radAjaxManager, ucChart2);
            radAjaxManager.AjaxRequest += radAjaxManager_AjaxRequest;
        }
コード例 #12
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(All, gridRequirements);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(Open, gridRequirements);

            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(chxByResponsible, gridRequirements, null, UpdatePanelRenderMode.Inline);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucResponsible, gridRequirements, null, UpdatePanelRenderMode.Inline);

            var accessCheck = Access.Check(TblUser, "Requirements");

            if (!accessCheck.Read)
            {
                Response.Redirect(UrlsData.LFP_Home(PortalSettingsId));
            }

            Title = "Требования";

            gridRequirements.ModuleName = "Requirements";

            gridRequirements.SiteID = SiteId;
            gridRequirements.Actions.Add(new GridAction {
                Text = "Карточка требования", NavigateUrl = "~/" + PortalSettingsId + "/Main/Requirements/Edit/{0}", ImageUrl = "~/App_Themes/Default/images/icoView.png"
            });

            ucResponsible.SelectedValue = CurrentUser.Instance.ContactID;

            if (!Page.IsPostBack)
            {
                gridRequirements.Where.Add(new GridWhere()
                {
                    CustomQuery = OpenQuery
                });
                AddSystemWhere();
            }
        }
コード例 #13
0
        /// <summary>
        /// Handles the OnItemDataBound event of the gridRequirementHistory control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        protected void gridShipmentHistory_OnItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                var item = (GridDataItem)e.Item;
                var data = (DataRowView)e.Item.DataItem;

                var lrlUserFullName   = (Literal)item.FindControl("lrlUserFullName");
                var lrlShipmentStatus = (Literal)item.FindControl("lrlShipmentStatus");

                if (!string.IsNullOrEmpty(data["tbl_ShipmentHistory_ShipmentStatusID"].ToString()))
                {
                    lrlShipmentStatus.Text =
                        EnumHelper.GetEnumDescription(
                            (ShipmentStatus)int.Parse(data["tbl_ShipmentHistory_ShipmentStatusID"].ToString()));
                }

                if (!string.IsNullOrEmpty(data["tbl_Contact_UserFullName"].ToString()))
                {
                    lrlUserFullName.Text = string.Format("<a href=\"{0}\">{1}</a>",
                                                         UrlsData.AP_Contact(
                                                             Guid.Parse(data["tbl_Contact_ID"].ToString())),
                                                         data["tbl_Contact_UserFullName"]);
                }
            }
        }
コード例 #14
0
ファイル: Task.aspx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Задача - LeadForce";

            if (!CurrentUser.Instance.ContactID.HasValue)
            {
                radWindowManager.RadAlert("Текущий пользователь не имеет контактной информации. Пожалуйста обновите данные.", 420, 100, "Предупреждение", "RedirectToTasksList");
                return;
            }

            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(dcbTaskType, ucTaskDurations);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(dcbTaskType, ucTaskMembers);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(dcbTaskType, rtsTabs);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(dcbTaskType, ucMainTaskMember);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucSaveTaskDuration, ucTaskDurations);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucTaskDurations, plDuration);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucSaveTaskDuration, plDuration);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucResponsible, ucTaskMembers);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(lbtnCharg, plStatuses);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(lbtnCharg, ucResponsible);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucResponsible, upCharg);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rbtnRun, plResult);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rbtnRun, plWorkflowResult);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(dcbProducts, ucTaskMembers);

            if (!string.IsNullOrEmpty(Request.QueryString["ctid"]))
            {
                ucTaskMembers.ContactId = Guid.Parse(Request.QueryString["ctid"]);
            }

            if (!string.IsNullOrEmpty(Request.QueryString["cyid"]))
            {
                ucTaskMembers.CompanyId = Guid.Parse(Request.QueryString["cyid"]);
            }

            ucTaskMembers.SiteId      = SiteId;
            ucTaskDurations.SiteId    = SiteId;
            ucSaveTaskDuration.SiteId = SiteId;

            ucSaveTaskDuration.SaveClicked       += ucSaveTaskDuration_SaveClicked;
            ucTaskDurations.TaskDurationsChanged += ucTaskDurations_TaskDurationsChanged;
            ucResponsible.SelectedIndexChanged   += ucResponsible_SelectedIndexChanged;
            rdpStartDate.SelectedDateChanged     += rdpStartDate_SelectedDateChanged;
            rdpEndDate.SelectedDateChanged       += rdpEndDate_SelectedDateChanged;
            dcbTaskType.SelectedIndexChanged     += dcbTaskType_SelectedIndexChanged;

            if (Page.RouteData.Values["id"] != null)
            {
                _taskId = Guid.Parse(Page.RouteData.Values["id"] as string);
            }

            ucTaskHistories.TaskId = _taskId;

            hlCancel.NavigateUrl = UrlsData.AP_Tasks();

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
コード例 #15
0
ファイル: WebSites.aspx.cs プロジェクト: VijayMVC/LeadForce
 protected void Page_Load(object sender, EventArgs e)
 {
     Title  = "Мини сайты - LeadForce";
     access = Access.Check();
     rbAddWebSite.NavigateUrl = UrlsData.AP_WebSiteAdd();
     gridWebSites.SiteID      = SiteId;
 }
コード例 #16
0
ファイル: WebSites.aspx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Handles the OnItemDataBound event of the gridWebSites control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        protected void gridWebSites_OnItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                if (access == null)
                {
                    access = Access.Check();
                }

                var item = (GridDataItem)e.Item;
                var data = (DataRowView)e.Item.DataItem;

                ((Literal)item.FindControl("lrlTitle")).Text        = data["tbl_WebSite_Title"].ToString();
                ((Literal)item.FindControl("lrlDescription")).Text  = data["tbl_WebSite_Description"].ToString();
                ((HyperLink)item.FindControl("hlEdit")).Visible     = access.Write;
                ((HyperLink)item.FindControl("hlEdit")).NavigateUrl = UrlsData.AP_WebSiteEdit(Guid.Parse(data["tbl_WebSite_ID"].ToString()));

                if (data["tbl_SiteDomain_Domain"] != DBNull.Value)
                {
                    var url    = DataManager.SiteDomain.GetDomainUrl((string)data["tbl_SiteDomain_Domain"]);
                    var result = url != null?url.ToString() : string.Empty;

                    ((Literal)item.FindControl("lrlUrl")).Text = result;
                }
                else
                {
                    ((Literal)item.FindControl("lrlUrl")).Text = BusinessLogicLayer.Configuration.Settings.MiniSiteUrl(Guid.Parse(data["tbl_WebSite_ID"].ToString()));
                }

                ((LinkButton)e.Item.FindControl("lbDelete")).CommandArgument = data["ID"].ToString();
                e.Item.FindControl("lbDelete").Visible = access.Delete;
            }
        }
コード例 #17
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Импорт - LeadForce";

            if (Page.RouteData.Values["id"] != null)
            {
                _importId = Guid.Parse(Page.RouteData.Values["id"] as string);
            }

            hlCancel.NavigateUrl = UrlsData.AP_Imports();

            if (!Page.IsPostBack)
            {
                ViewState["SheetName"] = string.Empty;

                BindData();
                BindImportColumns();

                _importColumnRules = DataManager.ImportColumnRules.SelectByImportID(_importId);
                BindImportColumnRules();
            }
            else
            {
                if (Request.Form["__EVENTTARGET"] == "ctl00$LabitecPage$ctl02$ContentHolder$lbtnSave") // !!!
                {
                    isPreviewed = true;
                }
            }

            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(pnlWarning, pnlWarning);
        }
コード例 #18
0
        protected void rtbFormButtons_OnButtonClick(object sender, RadToolBarEventArgs e)
        {
            switch (e.Item.Value)
            {
            case "LeadForce":
                Response.Redirect(UrlsData.AP_SiteActivityRuleAdd((int)RuleType.Form));
                break;

            case "Wizard":
                Response.Redirect(UrlsData.AP_FormWizard());
                break;

            case "External":
                Response.Redirect(UrlsData.AP_SiteActivityRuleAdd((int)RuleType.ExternalForm));
                break;

            case "Wufoo":
                if (!Page.ClientScript.IsStartupScriptRegistered("AddWufooForm"))
                {
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "AddWufooForm", "AddWufooForm();", true);
                }
                break;

            case "LPgenerator":
                Response.Redirect(UrlsData.AP_SiteActivityRuleAdd((int)RuleType.LPgenerator));
                break;
            }
        }
コード例 #19
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Карточка публикации - LeadForce";

            var fsp = new FileSystemProvider();

            if (Page.RouteData.Values["id"] != null)
            {
                _publicationID = Guid.Parse(Page.RouteData.Values["id"] as string);
            }


            hlCancel.NavigateUrl = UrlsData.AP_Publications();


            if (!Page.IsPostBack)
            {
                BindData();
            }

            radAjaxManager = RadAjaxManager.GetCurrent(Page);
            radAjaxManager.AjaxSettings.AddAjaxSetting(RadUpload1, rbiImage);

            radAjaxManager.AjaxSettings.AddAjaxSetting(rcbPublicationType, rcbPublicationStatus, null, UpdatePanelRenderMode.Inline);
            radAjaxManager.AjaxSettings.AddAjaxSetting(rcbPublicationType, ddlAccessRecord, null, UpdatePanelRenderMode.Inline);
            radAjaxManager.AjaxSettings.AddAjaxSetting(rcbPublicationType, ddlAccessComment, null, UpdatePanelRenderMode.Inline);
            radAjaxManager.AjaxSettings.AddAjaxSetting(ddlAccessRecord, plCompany, null, UpdatePanelRenderMode.Inline);

            tagsPublication.ObjectID = _publicationID;
        }
コード例 #20
0
ファイル: Companies.ascx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            siteID = ((LeadForceBasePage)Page).SiteId;

            gridCompanies.AddNavigateUrl = UrlsData.AP_CompanyAdd();
            gridCompanies.SiteID         = siteID;
        }
コード例 #21
0
ファイル: Requests.aspx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(All, gridRequests);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(New, gridRequests);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(Open, gridRequests);

            var user        = DataManager.User.SelectById(CurrentUser.Instance.ID);
            var accessCheck = Access.Check(user, "Requests");

            if (!accessCheck.Read)
            {
                Response.Redirect(UrlsData.LFP_AccessDenied(PortalSettingsId));
            }

            Title = "Запросы";

            gridRequests.ModuleName = "Requests";

            gridRequests.AddNavigateUrl = UrlsData.LFP_RequestAdd(PortalSettingsId);
            gridRequests.Actions.Add(new GridAction {
                Text = "Карточка запроса", NavigateUrl = "~/" + PortalSettingsId + "/Main/Requests/Edit/{0}", ImageUrl = "~/App_Themes/Default/images/icoView.png"
            });
            gridRequests.SiteID = SiteId;

            if (!Page.IsPostBack)
            {
                gridRequests.Where.Add(new GridWhere()
                {
                    CustomQuery = string.Format("RequestStatusID <> {0}", (int)RequestStatus.Closed)
                });
                AddSystemWhere();
            }
        }
コード例 #22
0
ファイル: Segment.ascx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            access = Access.Check();
            if (!access.Write)
            {
                lbtnSave.Visible = false;
            }

            SiteId = ((LeadForceBasePage)Page).SiteId;
            string segmentId = Page.RouteData.Values["id"] as string;

            if (!Guid.TryParse(segmentId, out _segmentID))
            {
                //    Response.Redirect(UrlsData.AP_ContactSegments());
            }


            hlCancel.NavigateUrl = UrlsData.AP_ContactSegments();
            gridSegments.SiteID  = ((LeadForceBasePage)Page).SiteId;



            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
コード例 #23
0
ファイル: MassMails.aspx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Handles the OnItemDataBound event of the gridMassMails control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void gridMassMails_OnItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                if (access == null)
                {
                    access = Access.Check();
                }

                var item = (GridDataItem)e.Item;
                var data = (DataRowView)e.Item.DataItem;

                var litStatus = (Literal)item.FindControl("litStatus");
                litStatus.Text = EnumHelper.GetEnumDescription((MassMailStatus)data["tbl_MassMail_MassMailStatusID"].ToString().ToInt());

                ((HyperLink)item.FindControl("spanName")).Text        = data["tbl_MassMail_Name"].ToString();
                ((HyperLink)item.FindControl("spanName")).NavigateUrl = UrlsData.AP_MassMail(Guid.Parse(data["ID"].ToString()));
                ((Literal)item.FindControl("lMailDate")).Text         = data["tbl_MassMail_MailDate"].ToString();

                var lbEdit = (LinkButton)e.Item.FindControl("lbEdit");
                lbEdit.CommandArgument = data["ID"].ToString();
                lbEdit.Command        += new CommandEventHandler(lbEdit_OnCommand);


                var lbDelete = (LinkButton)e.Item.FindControl("lbDelete");
                lbDelete.CommandArgument = data["ID"].ToString();
                lbDelete.Command        += new CommandEventHandler(lbDelete_OnCommand);
                lbDelete.Visible         = access.Delete;
            }
        }
コード例 #24
0
        /// <summary>
        /// Handles the OnItemDataBound event of the gridContacts control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        protected void gridContacts_OnItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                var item = (GridDataItem)e.Item;
                var data = (DataRowView)e.Item.DataItem;

                ((HyperLink)item.FindControl("hlEdit")).NavigateUrl = UrlsData.AP_Contact(Guid.Parse(data["ID"].ToString()));

                ((Literal)item.FindControl("litPriority")).Text = data["tbl_Priorities_Title"].ToString();
                if (!string.IsNullOrEmpty(data["tbl_Priorities_Image"].ToString()))
                {
                    ((Image)item.FindControl("imgPriority")).ImageUrl      = BusinessLogicLayer.Configuration.Settings.DictionaryLogoPath(SiteId, "tbl_Priorities") + data["tbl_Priorities_Image"];
                    ((Image)item.FindControl("imgPriority")).AlternateText = ((Image)item.FindControl("imgPriority")).ToolTip = data["tbl_Priorities_Title"].ToString();
                    ((Image)item.FindControl("imgPriority")).Visible       = true;
                }

                ((Literal)item.FindControl("litReadyToSell")).Text = data["tbl_ReadyToSell_Title"].ToString();
                if (!string.IsNullOrEmpty(data["tbl_ReadyToSell_Image"].ToString()))
                {
                    ((Image)item.FindControl("imgReadyToSell")).ImageUrl      = BusinessLogicLayer.Configuration.Settings.DictionaryLogoPath(SiteId, "tbl_ReadyToSell") + data["tbl_ReadyToSell_Image"];
                    ((Image)item.FindControl("imgReadyToSell")).AlternateText = ((Image)item.FindControl("imgReadyToSell")).ToolTip = data["tbl_ReadyToSell_Title"].ToString();
                    ((Image)item.FindControl("imgReadyToSell")).Visible       = true;
                }
            }
        }
コード例 #25
0
 /// <summary>
 /// Handles the OnLogoutClick event of the MainMenu control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void MainMenu_OnLogoutClick(object sender, EventArgs e)
 {
     HttpContext.Current.Session.Remove("siteID");
     CurrentUser.UserInstanceFlush();
     FormsAuthentication.SignOut();
     Response.Redirect(UrlsData.LFP_Home(((LeadForcePortalBasePage)Page).PortalSettingsId));
 }
コード例 #26
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Продукты - LeadForce";


            //var sCategoryId = Page.RouteData.Values["categoryId"] as string;
            //if (!string.IsNullOrEmpty(sCategoryId))
            //    CategoryId = Guid.Parse(sCategoryId);

            if (Page.RouteData.Values["categoryId"] != null)
            {
                CategoryId = Guid.Parse(Page.RouteData.Values["categoryId"] as string);
            }

            ((ProductCategories)RadPanelBar1.Items[2].FindControl("ucCategoryID")).SiteID     = SiteId;
            ((ProductCategories)RadPanelBar1.Items[2].FindControl("ucCategoryID")).CategoryID = CategoryId;

            gridProducts.AddNavigateUrl = UrlsData.AP_ProductAdd();
            gridProducts.Actions.Add(new GridAction {
                Text = "Карточка продукта", NavigateUrl = string.Format("~/{0}/Products/Edit/{{0}}", CurrentTab), ImageUrl = "~/App_Themes/Default/images/icoView.png"
            });
            gridProducts.SiteID = SiteId;

            if (CategoryId != Guid.Empty)
            {
                gridProducts.Where = new List <GridWhere>();
                gridProducts.Where.Add(new GridWhere {
                    Column = "ProductCategoryID", Value = CategoryId.ToString()
                });
            }
        }
コード例 #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var site                  = DataManager.Sites.SelectById(CurrentUser.Instance.SiteID);
            var totalPageCount        = site.tbl_SiteDomain.Sum(o => o.TotalPageCount);
            var pageCountWithForms    = site.tbl_SiteDomain.Sum(o => o.PageCountWithForms);
            var pageCountWithoutForms = totalPageCount - pageCountWithForms;

            lrlTotalPages.Text = totalPageCount.ToString();
            lrlTotalForms.Text = pageCountWithForms.ToString();

            if (totalPageCount != 0 && pageCountWithoutForms / ((decimal)totalPageCount / 100) > 10)
            {
                var    menu = DataManager.Menu.SelectByAccessProfileID(AccessProfile.ID).FirstOrDefault(o => o.ModuleID.HasValue && o.tbl_Module.Name == "Form");
                string url;
                if (menu != null)
                {
                    var tab = string.IsNullOrEmpty(menu.TabName) && menu.ParentID.HasValue ? DataManager.Menu.SelectByID(menu.ParentID.Value).TabName : menu.TabName;
                    url = ResolveUrl(string.Format("~/{0}/{1}/List", tab, menu.tbl_Module.Name));
                }
                else
                {
                    url = UrlsData.AP_SiteActivityRules((int)RuleType.Form, "Evaluation");
                }

                lrlMessage.Text = string.Format("<li class=\"widget-error\">{0} страниц не содержит контактных форм! <a href=\"{1}\">Перейти к модулю Формы</a></li>", pageCountWithoutForms, url);
            }

            var clientBaseGrowthTemplateForms = DataManager.StatisticData.ClientBaseGrowthTemplateForm;
            var sb = new StringBuilder();

            foreach (var clientBaseGrowthTemplateForm in clientBaseGrowthTemplateForms)
            {
                if (clientBaseGrowthTemplateForm.Value.DbValue == 0)
                {
                    continue;
                }

                var siteActivityRule = DataManager.SiteActivityRules.SelectById(Guid.Parse(clientBaseGrowthTemplateForm.Key.Split('_')[1]));
                sb.Append(string.Format("<li>{0} {1}</li>", siteActivityRule.Name, clientBaseGrowthTemplateForm.Value.DbValue.ToString("F0")));
            }

            lrlClientBaseGrowthTemplateForm.Text = sb.ToString();

            if (DataManager.StatisticData.ClientBaseOtherFormsCount.DbValue > 0)
            {
                lrlClientBaseOtherFormsCount.Text = string.Format("<li>Другие <b>{0}</b></li>", DataManager.StatisticData.ClientBaseOtherFormsCount.DbValue.ToString("F0"));
            }

            if (!string.IsNullOrEmpty(lrlClientBaseGrowthTemplateForm.Text) || !string.IsNullOrEmpty(lrlClientBaseOtherFormsCount.Text))
            {
                lrlTitle.Text = "Из них";
            }
            else
            {
                lrlTitle.Text = string.Empty;
            }

            rbtnImport.NavigateUrl = GetImportUrl();
        }
コード例 #28
0
ファイル: Default.aspx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Request.Url.ToString().ToLower().Contains("leadforce/main/list"))
            {
                Response.Redirect(UrlsData.AP_Home());
            }

            Title = "LeadForce";

            AjaxManager = RadAjaxManager.GetCurrent(Page);
            AjaxManager.AjaxSettings.AddAjaxSetting(AjaxManager, rcbReports, null, UpdatePanelRenderMode.Inline);
            AjaxManager.AjaxSettings.AddAjaxSetting(AjaxManager, txtName, null, UpdatePanelRenderMode.Inline);
            AjaxManager.AjaxSettings.AddAjaxSetting(rcbReports, txtName, null, UpdatePanelRenderMode.Inline);
            AjaxManager.AjaxSettings.AddAjaxSetting(rcbReports, plSelectAxis, null, UpdatePanelRenderMode.Inline);
            AjaxManager.AjaxSettings.AddAjaxSetting(rcbReports, plSelectedAxisValues, null, UpdatePanelRenderMode.Inline);
            AjaxManager.AjaxSettings.AddAjaxSetting(ddlSelectAxis, chxlSeries, null, UpdatePanelRenderMode.Inline);

            RadAjaxManager.GetCurrent(Page).AjaxRequest += Default_AjaxRequest;

            var showDomainStatusSettings = ((LeadForceBasePage)Page).CurrentModuleEditionOptions.SingleOrDefault(a => a.SystemName == "ShowDomainStatusSettings");

            if (showDomainStatusSettings == null && !((LeadForceBasePage)Page).IsDefaultEdition)
            {
                plShowDomainStatusSettings.Visible = false;
            }
            else
            {
                var siteDomain = DataManager.SiteDomain.SelectBySiteId(CurrentUser.Instance.SiteID);
                plShowDomainStatusSettings.Visible = ucNotificationMessage.Visible = siteDomain == null;
                if (ucNotificationMessage.Visible)
                {
                    var site = DataManager.Sites.SelectById(CurrentUser.Instance.SiteID);
                    if (site != null)
                    {
                        ucNotificationMessage.Text =
                            string.Format(
                                "Для начала работы Вам необходимо привязать {0} к домену. Для этого укажите Ваш домен в форме ниже и нажмите кнопку [Проверить и сохранить]",
                                site.Name);
                    }

                    if (siteDomain != null)
                    {
                        if (!Page.IsPostBack)
                        {
                            txtDomain.Text  = siteDomain.Domain;
                            txtAliases.Text = siteDomain.Aliases;
                            lrlNote.Text    = siteDomain.Note;
                        }
                    }
                }
            }

            if (!string.IsNullOrEmpty(Request.QueryString["tab"]) && Request.QueryString["tab"] == "chart")
            {
                RadTabStrip1.Tabs[1].Selected       = true;
                RadMultiPage1.PageViews[1].Selected = true;
                plCharts.Visible = true;
            }
        }
コード例 #29
0
        /// <summary>
        /// Handles the OnClick event of the lbtnSave control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void lbtnSave_OnClick(object sender, EventArgs e)
        {
            var accessCheck = Access.Check(TblUser, "Requests");

            if (!accessCheck.Write)
            {
                Response.Redirect(UrlsData.LFP_AccessDenied(PortalSettingsId));
            }

            var requestSourceType = DataManager.RequestSourceType.SelectBySourceCategoryId(SiteId, RequestSourceCategory.Request);

            if (requestSourceType == null)
            {
                ucNotificationMessage.Text = "Запрос не зарегистрирован. В справочнике отсутствует тип запроса с категорией \"Обращение\"";
                return;
            }

            var request = new tbl_Request
            {
                SiteID              = SiteId,
                CreatedAt           = DateTime.Now,
                ServiceLevelID      = ServiceLevel.ID,
                ContactID           = Contact.ID,
                CompanyID           = Contact.CompanyID,
                RequestStatusID     = (int)RequestStatus.New,
                RequestSourceTypeID = requestSourceType.ID,
                ShortDescription    = txtShortDescription.Text,
                LongDescription     = ucLongDescription.Content,
                ReactionDateActual  = null,
            };

            request.ReactionDatePlanned = request.CreatedAt.AddHours(ServiceLevel.ReactionTime);


            var documentNumerator = DocumentNumerator.GetNumber((Guid)requestSourceType.NumeratorID,
                                                                request.CreatedAt,
                                                                requestSourceType.tbl_Numerator.Mask, "tbl_Request");

            request.Number       = documentNumerator.Number;
            request.SerialNumber = documentNumerator.SerialNumber;


            DataManager.Request.Add(request);

            if (rauRequestFiles.UploadedFiles.Count > 0)
            {
                var fsp = new FileSystemProvider();
                foreach (UploadedFile file in rauRequestFiles.UploadedFiles)
                {
                    var fileName = fsp.Upload(SiteId, "Requests", file.FileName, file.InputStream, FileType.Attachment);
                    DataManager.RequestFile.Add(new tbl_RequestFile()
                    {
                        RequestID = request.ID, FileName = fileName
                    });
                }
            }

            Response.Redirect(UrlsData.LFP_Requests(PortalSettingsId));
        }
コード例 #30
0
ファイル: Invoice.aspx.cs プロジェクト: VijayMVC/LeadForce
        /// <summary>
        /// Binds the data.
        /// </summary>
        private void BindData()
        {
            if (ObjectId != Guid.Empty)
            {
                var invoice = DataManager.Invoice.SelectById(SiteId, ObjectId);
                if (invoice != null)
                {
                    CheckReadAccess(invoice.OwnerID, "Invoices");

                    Title             =
                        lrlTitle.Text =
                            string.Format("Счет №{0} от {1}", invoice.Number,
                                          invoice.CreatedAt.ToString("dd.MM.yyyy"));

                    lrlInvoiceStatus.Text = EnumHelper.GetEnumDescription((InvoiceStatus)invoice.InvoiceStatusID);
                    lrlInvoiceAmount.Text = invoice.InvoiceAmount.ToString("F");
                    rbtnPrint.NavigateUrl = UrlsData.LFP_InvoicePrint(ObjectId, PortalSettingsId);

                    if (invoice.ExecutorContactID.HasValue)
                    {
                        lrlExecutorContact.Text =
                            DataManager.Contact.SelectById(CurrentUser.Instance.SiteID, invoice.ExecutorContactID.Value)
                            .UserFullName;
                    }

                    if (invoice.BuyerCompanyLegalAccountID.HasValue)
                    {
                        lbtnBuyerCompanyLegal.Text            = DataManager.CompanyLegalAccount.SelectById(invoice.BuyerCompanyLegalAccountID.Value).Title;
                        lbtnBuyerCompanyLegal.CommandArgument = invoice.BuyerCompanyLegalAccountID.Value.ToString();
                    }

                    if (invoice.ExecutorCompanyLegalAccountID.HasValue)
                    {
                        lbtnExecutorCompanyLegal.Text            = DataManager.CompanyLegalAccount.SelectById(invoice.ExecutorCompanyLegalAccountID.Value).Title;
                        lbtnExecutorCompanyLegal.CommandArgument = invoice.ExecutorCompanyLegalAccountID.Value.ToString();
                    }

                    if (invoice.PaymentDateActual.HasValue)
                    {
                        lrlPaymentDateActual.Text = invoice.PaymentDateActual.Value.ToString("dd.MM.yyyy");
                    }

                    if (invoice.PaymentDatePlanned.HasValue)
                    {
                        lrlPaymentDatePlanned.Text = invoice.PaymentDatePlanned.Value.ToString("dd.MM.yyyy");
                    }

                    lrlNote.Text = invoice.Note;

                    rprInvoiceProducts.DataSource = DataManager.InvoiceProducts.SelectAll(invoice.ID);
                    rprInvoiceProducts.DataBind();

                    lrlInvoiceAmount1.Text = invoice.InvoiceAmount.ToString("F");
                    lrlInvoiceAmount2.Text = invoice.InvoiceAmount.ToString("F");

                    plNote.Visible = invoice.IsPaymentDateFixedByContract;
                }
            }
        }