Example #1
0
        protected Boolean saveDataItem()
        {
            if (!CHelper.VerifyAccessRight(accessRightName))
            {
                return(false);
            }

            if (!vw.IsModified)
            {
                return(true);
            }

            if (!validateData())
            {
                return(false);
            }

            beforeSaveItem();

            CUtil.EnableForm(false, this);
            if (loadParam.Mode.Equals("A"))
            {
                addSubItem();
            }
            else if (loadParam.Mode.Equals("E"))
            {
                CTable o = loadParam.ActualView.GetDbObject();
                o.CopyFrom(vw.GetDbObject());
                loadParam.ActualView.NotifyAllPropertiesChanged();
            }
            CUtil.EnableForm(true, this);

            return(true);
        }
Example #2
0
        public void AddChildItems(ObservableCollection <MCompanyCommissionProfile> items, MCompanyCommissionProfile vw, MCommissionProfile cv)
        {
            CTable t = new CTable("COMPANY_COMM_PROFILE");

            t.CopyFrom(cv.GetDbObject());

            MCompanyCommissionProfile v = new MCompanyCommissionProfile(t);

            v.CompanyCommProfID = "";
            v.CompanyID         = "1";
            v.SeqNo             = (v.GetMaxSeqNo((items)) + 1).ToString();

            CTable    o   = GetDbObject();
            ArrayList arr = o.GetChildArray("COMPANY_COMM_PROFILE_ITEM");

            if (arr == null)
            {
                arr = new ArrayList();
                o.AddChildArray("COMPANY_COMM_PROFILE_ITEM", arr);
            }

            arr.Add(t);
            items.Add(v);

            v.ExtFlag = "A";
        }
Example #3
0
        private Boolean SaveData()
        {
            if (Mode.Equals("A"))
            {
                if (SaveToView())
                {
                    parentView.AddAccountDocItem(vw);
                    return(true);
                }

                return(false);
            }
            else if (Mode.Equals("E"))
            {
                if (vw.IsModified)
                {
                    Boolean result = SaveToView();
                    if (result)
                    {
                        CTable o = actualView.GetDbObject();
                        o.CopyFrom(vw.GetDbObject());

                        actualView.NotifyAllPropertiesChanged();

                        return(true);
                    }

                    return(false);
                }
            }

            return(true);
        }
        private Boolean SaveData()
        {
            if (!vw.IsModified)
            {
                return(true);
            }

            Boolean result = SaveToView();

            if (!result)
            {
                return(false);
            }

            if (mode.Equals("A"))
            {
                parentObj.AddConfigVariable(vw);
            }
            else if (mode.Equals("E"))
            {
                CTable o = actualView.GetDbObject();
                o.CopyFrom(vw.GetDbObject());
                actualView.NotifyAllPropertiesChanged();
            }
            else if (mode.Equals("O"))
            {
                parentObj.OverrideConfigVariable(vw);
            }

            return(true);
        }