Ejemplo n.º 1
0
        public ActionResult ViewCase(int flowCaseId)
        {
            ApplicationUser manager    = new ApplicationUser(WFEntities, this.Username);
            PropertiesValue properties = manager.GetProperties(flowCaseId);
            FlowInfo        info       = manager.GetFlowAndCase(flowCaseId);

            manager.SetCaseAsViewed(flowCaseId, this.Username);
            manager.UpdateLastChecked(flowCaseId, this.Username);
            WF_FlowTypes flowType = manager.GetFlowTypeById(info.FlowTypeId);

            if (flowType.TemplateType.HasValue && flowType.TemplateType.Value == 7)
            {
                WF_FlowPropertys prop = properties.PropertyInfo.FirstOrDefault(p => p.PropertyName.ToLower().Equals("brand") && p.StatusId < 0);
                if (prop != null)
                {
                    string brand = properties.Values.FirstOrDefault(p => p.PropertyId == prop.FlowPropertyId)?.StringValue;
                    Dictionary <string, string> shopList = WFEntities.BLSShopView
                                                           .Where(s => s.Brand.ToLower().Equals(brand.ToLower()))
                                                           .Select(s => new { s.ShopCode, s.ShopName })
                                                           .ToDictionary(s => s.ShopCode, s => s.ShopName);
                    ViewBag.ShopList = shopList;
                }
            }
            ViewBag.Properties  = properties;
            ViewBag.Attachments = manager.GetAttachments(flowCaseId);
            ViewBag.FlowType    = flowType;
            ViewBag.History     = manager.GetCaseHistory(info.CaseInfo.FlowCaseId, info.CaseInfo.BaseFlowCaseId);
            return(PartialView(info));
        }
        public PropertiesEntry GetPropertiesEntry()
        {
            var key           = Key.Replace("-", ".");
            var propertiesSet = PropertiesProvider.GetInstance(key);

            var entry            = new PropertiesEntry(key);
            var propertiesValues = new List <PropertiesValue>();

            foreach (var propertiesElement in Properties)
            {
                var property = propertiesSet.GetType().GetProperty(propertiesElement.Key.Replace("-", "."));
                if (property != null)
                {
                    foreach (var propertyValue in propertiesElement.Values)
                    {
                        var value           = ParsePropertyValue(property.PropertyType, propertyValue.Value);
                        var propertiesValue = propertiesValues.FirstOrDefault(v => v.SiteId == propertyValue.SiteId);
                        if (propertiesValue == null)
                        {
                            propertiesValue = new PropertiesValue(propertyValue.SiteId, PropertiesProvider.GetInstance(key));
                            propertiesValues.Add(propertiesValue);
                        }

                        property.SetValue(propertiesValue.Value, value);
                    }
                }
            }

            entry.Properties.AddRange(propertiesValues);

            return(entry);
        }
        public void AddUpdateRecordValue(object context)
        {
            var itemIndex = Convert.ToInt32(context);

            Controller.ShowListViewItemViewDialog(PropertiesValue.ElementAt(itemIndex));
        }
Ejemplo n.º 4
0
 public PropValueResolver(PropertiesValue caseValues)
 {
     _caseValues = caseValues;
 }