Exemplo n.º 1
0
        public ActionResult StatisticConditionDetailEdit(long siteId, long ConditionID, long?DetailID)
        {
            SetDefaultConditionDetailCodes(siteId, ConditionID, DetailID);
            StatisticConditionDetailModels item = null;

            if (DetailID.HasValue)
            {
                item = StatisticConditionDAO.GetDetailItem(DetailID.Value);
            }

            return(View(item));
        }
Exemplo n.º 2
0
        public ActionResult StatisticConditionDetailEdit(long siteId, long ConditionID, StatisticConditionDetailModels item
                                                         , string[] Pages, string[] Manager, string[] MachineNames, string[] Browsers, string[] Sex
                                                         , string[] ageFilter, string ageFilter_customStart, string ageFilter_customEnd, string Regions, string Address, string[] Marriage
                                                         , string[] Education, string[] Career, string[] Identity, string[] Favority, string[] EpeprOrder)
        {
            string AnalysisItems = "";

            if (item.AnalysisType == AnalysisType.Page)
            {
                if (Pages != null)
                {
                    foreach (string page in Pages)
                    {
                        if (!string.IsNullOrEmpty(page))
                        {
                            AnalysisItems += page + ";";
                        }
                    }
                }
            }
            if (item.AnalysisType == AnalysisType.Manager)
            {
                if (Manager != null)
                {
                    foreach (string manager in Manager)
                    {
                        if (!string.IsNullOrEmpty(manager))
                        {
                            AnalysisItems += manager + ";";
                        }
                    }
                }
            }
            if (item.AnalysisType == AnalysisType.Machine)
            {
                if (MachineNames != null)
                {
                    foreach (string MachineName in MachineNames)
                    {
                        if (!string.IsNullOrEmpty(MachineName))
                        {
                            AnalysisItems += MachineName + ";";
                        }
                    }
                }
            }
            if (item.AnalysisType == AnalysisType.Browser)
            {
                if (Browsers != null)
                {
                    foreach (string Browser in Browsers)
                    {
                        if (!string.IsNullOrEmpty(Browser))
                        {
                            AnalysisItems += Browser + ";";
                        }
                    }
                }
            }
            if (item.AnalysisType == AnalysisType.Sex)
            {
                if (Sex != null)
                {
                    foreach (string sex in Sex)
                    {
                        if (!string.IsNullOrEmpty(sex))
                        {
                            AnalysisItems += sex + ";";
                        }
                    }
                }
            }
            if (item.AnalysisType == AnalysisType.Age)
            {
                if (ageFilter != null)
                {
                    foreach (string age in ageFilter)
                    {
                        if (!string.IsNullOrEmpty(age))
                        {
                            if (age.Contains("other"))
                            {
                                AnalysisItems += age + ":" + ageFilter_customStart + "-" + ageFilter_customEnd + ";";
                            }
                            else
                            {
                                AnalysisItems += age + ";";
                            }
                        }
                    }
                }
            }
            if (item.AnalysisType == AnalysisType.Location)
            {
                if (!string.IsNullOrEmpty(Regions))
                {
                    AnalysisItems += Regions + ";";
                }
                if (!string.IsNullOrEmpty(Address))
                {
                    AnalysisItems += Address + ";";
                }
            }
            if (item.AnalysisType == AnalysisType.Marriage)
            {
                if (Marriage != null)
                {
                    foreach (string marriage in Marriage)
                    {
                        if (!string.IsNullOrEmpty(marriage))
                        {
                            AnalysisItems += marriage + ";";
                        }
                    }
                }
            }
            if (item.AnalysisType == AnalysisType.Education)
            {
                if (Education != null)
                {
                    foreach (string education in Education)
                    {
                        if (!string.IsNullOrEmpty(education))
                        {
                            AnalysisItems += education + ";";
                        }
                    }
                }
            }
            if (item.AnalysisType == AnalysisType.Career)
            {
                if (Career != null)
                {
                    foreach (string career in Career)
                    {
                        if (!string.IsNullOrEmpty(career))
                        {
                            AnalysisItems += career + ";";
                        }
                    }
                }
            }
            if (item.AnalysisType == AnalysisType.Identity)
            {
                if (Identity != null)
                {
                    foreach (string identity in Identity)
                    {
                        if (!string.IsNullOrEmpty(identity))
                        {
                            AnalysisItems += identity + ";";
                        }
                    }
                }
            }
            if (item.AnalysisType == AnalysisType.Favority)
            {
                if (Favority != null)
                {
                    foreach (string favority in Favority)
                    {
                        if (!string.IsNullOrEmpty(favority))
                        {
                            AnalysisItems += favority + ";";
                        }
                    }
                }
            }
            if (item.AnalysisType == AnalysisType.OrderEpaper)
            {
                if (EpeprOrder != null)
                {
                    foreach (string epeprOrder in EpeprOrder)
                    {
                        if (!string.IsNullOrEmpty(epeprOrder))
                        {
                            AnalysisItems += epeprOrder + ";";
                        }
                    }
                }
            }
            item.AnalysisItems = AnalysisItems.Trim(';');
            if (string.IsNullOrEmpty(item.ID) || item.ID == "0")
            {
                item.ID = WorkLib.GetItem.NewSN().ToString();
            }
            bool result = Models.DataAccess.StatisticConditionDAO.SetDetailItem(item);

            if (result)
            {
                ViewBag.Exit = true;
            }
            SetDefaultConditionDetailCodes(siteId, ConditionID, long.Parse(item.ID));
            ViewBag.HasDetailData = true;
            return(View(item));
        }