예제 #1
0
        public override void Init(String type)
        {
            createCriteriaEntries();
            createGridColumns();

            if (!CMasterReference.IsCategoryItemLoaded())
            {
                CMasterReference.LoadItemCategoryPathList(true, null);
            }
        }
예제 #2
0
 public void LoadData()
 {
     CUtil.EnableForm(false, this);
     CMasterReference.LoadItemCategoryPathList(true, null);
     CUtil.EnableForm(true, this);
 }
예제 #3
0
        private Boolean SaveData()
        {
            if (!CHelper.VerifyAccessRight("ITEM_CATEGORY_EDIT"))
            {
                return(false);
            }

            if (Mode.Equals("A"))
            {
                if (SaveToView())
                {
                    CUtil.EnableForm(false, this);
                    CTable newobj = OnixWebServiceAPI.CreateItemCategory(vw.GetDbObject());

                    if (newobj != null)
                    {
                        vw.SetDbObject(newobj);
                        vw.ChildCount = "0"; //Always
                        CMasterReference.Instance.AddCategoryToTree(vw);

                        CMasterReference.LoadItemCategoryPathList(true, null);
                        CUtil.EnableForm(true, this);
                        return(true);
                    }

                    //Error here
                    CUtil.EnableForm(true, this);
                    CHelper.ShowErorMessage(OnixWebServiceAPI.GetLastErrorDescription(), "ERROR_USER_ADD", null);
                    return(false);
                }
            }
            else if (Mode.Equals("E"))
            {
                if (isModified)
                {
                    Boolean result = SaveToView();
                    if (result)
                    {
                        CUtil.EnableForm(false, this);
                        actualView.CategoryName = vw.CategoryName.ToString();
                        CTable t = OnixWebServiceAPI.UpdateItemCategory(actualView.GetDbObject());
                        if (t != null)
                        {
                            actualView.SetDbObject(t);
                            CMasterReference.Instance.EditCategoryInTree(actualView);

                            CMasterReference.LoadItemCategoryPathList(true, null);
                            CUtil.EnableForm(true, this);
                            return(true);
                        }

                        CUtil.EnableForm(true, this);
                        CHelper.ShowErorMessage(OnixWebServiceAPI.GetLastErrorDescription(), "ERROR_USER_EDIT", null);
                    }

                    return(false);
                }

                return(true);
            }

            return(false);
        }