Exemple #1
0
        private int?GetRmaId()
        {
            Durados.Web.Mvc.UI.Json.Filter jsonFilter = ViewHelper.ConvertQueryStringToJsonFilter(currentGuid);

            if (jsonFilter == null)
            {
                return(null);
            }

            string fkFieldName = "RmaId";

            if (!jsonFilter.Fields.ContainsKey(fkFieldName))
            {
                return(null);
            }
            object value = jsonFilter.Fields[fkFieldName].Value;

            if (value == null || value.ToString() == string.Empty)
            {
                return(null);
            }

            return(Convert.ToInt32(jsonFilter.Fields[fkFieldName].Value));
        }
Exemple #2
0
        public virtual Json.Chart GetChart(View view, int top, FormCollection collection, string search, string SortColumn, SortDirection sortDirection, out int rowCount, out Durados.Web.Mvc.UI.Json.Filter filter, string guid, BeforeSelectEventHandler beforeSelectCallback, AfterSelectEventHandler afterSelectCallback)
        {
            rowCount = 0;
            filter   = null;
            DataView dataView = view.ApplyFilter(0, top, collection, !string.IsNullOrEmpty(search), SortColumn, sortDirection, out rowCount, out filter, guid, beforeSelectCallback, afterSelectCallback);

            return(GetChart(view, dataView));
        }
Exemple #3
0
        public FabLotPlanFilter(View view, string guid)
        {
            Durados.Web.Mvc.UI.ViewViewer viewViewer = new Durados.Web.Mvc.UI.ViewViewer();

            System.Web.Mvc.FormCollection  collection = new System.Web.Mvc.FormCollection(ViewHelper.GetSessionState(guid + "Filter"));
            Durados.Web.Mvc.UI.Json.Filter filter     = Durados.Web.Mvc.UI.Json.JsonSerializer.Deserialize <Durados.Web.Mvc.UI.Json.Filter>(collection["jsonFilter"]);

            string fabFieldName = GetFabFieldName();

            if (filter.Fields.ContainsKey(fabFieldName))
            {
                object value = filter.Fields[fabFieldName].Value;
                if (value != null && value.ToString() != string.Empty)
                {
                    Fab = Convert.ToInt32(value);
                }
                else
                {
                    Fab = -1;
                }
            }

            string technologyFieldName = GetTechnologyFieldName();

            if (filter.Fields.ContainsKey(technologyFieldName))
            {
                object value = filter.Fields[technologyFieldName].Value;
                if (value != null)
                {
                    Technology = Convert.ToInt32(value);
                }
            }

            string memoryFieldName = GetMemoryFieldName();

            if (filter.Fields.ContainsKey(memoryFieldName))
            {
                object value = filter.Fields[memoryFieldName].Value;
                if (value != null)
                {
                    Memory = Convert.ToInt32(value);
                }
            }

            string eccFieldName = GetEccFieldName();

            if (filter.Fields.ContainsKey(eccFieldName))
            {
                object value = filter.Fields[eccFieldName].Value;
                if (value != null)
                {
                    Ecc = Convert.ToInt32(value);
                }
            }

            string dateFieldName = GetProductionOutFieldName();

            if (filter.Fields.ContainsKey(dateFieldName))
            {
                object value = filter.Fields[dateFieldName].Value;
                if (value == null)
                {
                    Date = DateTime.Now.Date;
                }
                else
                {
                    if (value.ToString() == string.Empty)
                    {
                        Date = DateTime.Now.Date;
                    }
                    else
                    {
                        Date = Convert.ToDateTime(value);
                    }
                }
            }
        }
Exemple #4
0
 public override void HandleFilter(Durados.Web.Mvc.UI.Json.Filter jsonFilter)
 {
     jsonFilter.Fields["ProductionOut"].Value = string.Empty;
 }
Exemple #5
0
        public Json.Filter GetJsonFilter(View view, string guid)
        {
            Json.Filter jsonFilter = new Json.Filter();

            //foreach (Field field in view.VisibleFieldsForFilter)
            foreach (Field field in view.Fields.Values)
            {
                string type = (field.FieldType == FieldType.Children) ? "Children" : field.GetHtmlControlType().ToString();
                jsonFilter.Fields.Add(field.Name, new Json.Field()
                {
                    Name = field.Name, Type = type, Searchable = field.IsSearchable(), Permanent = false
                });
            }

            Durados.Web.Mvc.UI.Json.Filter pageFilter = view.GetPageFilter(guid);
            string parentFieldName = pageFilter.GetParentFiterFieldName();

            if (!string.IsNullOrEmpty(parentFieldName))
            {
                if (jsonFilter.Fields.ContainsKey(parentFieldName))
                {
                    Field  field    = view.Fields[parentFieldName];
                    string fieldVal = string.Empty;
                    foreach (string s in field.DatabaseNames.Split(','))
                    {
                        fieldVal += string.Format("{0},", ViewHelper.GetSessionState(guid + "PageFilterState")[s]);
                    }

                    jsonFilter.Fields[parentFieldName].Value = fieldVal.TrimEnd(',');
                    if (field.FieldType == FieldType.Parent)
                    {
                        ParentField parentField = (ParentField)field;
                        //if (parentField.ParentHtmlControlType == ParentHtmlControlType.Autocomplete)
                        //{
                        string pk = jsonFilter.Fields[parentFieldName].Value.ToString();
                        jsonFilter.Fields[parentFieldName].Default = parentField.GetDisplayValue(pk);
                        //}
                    }
                    else if (field.FieldType == FieldType.Column)
                    {
                    }


                    jsonFilter.Fields[parentFieldName].Permanent = true;
                }
                else
                {
                    if (view.IsDerived)
                    {
                        string derivedFieldName = view.GetDerivedParentField(parentFieldName).Name;
                        if (jsonFilter.Fields.ContainsKey(derivedFieldName))
                        {
                            jsonFilter.Fields[derivedFieldName].Value     = ViewHelper.GetSessionState(guid + "PageFilterState")[0];
                            jsonFilter.Fields[derivedFieldName].Permanent = true;
                        }
                    }
                }
            }



            return(jsonFilter);
        }