예제 #1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        public int Save()
        {
            EnCfg cfg = new EnCfg(this.HisEn.ToString());

            cfg.UI = this.HisAP.GenerAtParaStrs();
            return(cfg.Save());
        }
예제 #2
0
        /// <summary>
        /// UI的设置.Search. Card, Group信息.
        /// </summary>
        /// <param name="enName"></param>
        public UIConfig(Entity en)
        {
            this.HisEn = en;
            EnCfg  cfg     = new EnCfg(en.ToString());
            string paraStr = cfg.UI;

            if (DataType.IsNullOrEmpty(paraStr) == true)
            {
                paraStr = "@UIRowStyleGlo=0@IsEnableDouclickGlo=1@IsEnableRefFunc=1@IsEnableFocusField=1@IsEnableOpenICON=1@FocusField=''@WinCardH=600@@WinCardW=800@ShowColumns=";
            }
            HisAP = new AtPara(paraStr);
        }
    void btn_Click(object sender, EventArgs e)
    {
        Entity en   = BP.En.ClassFactory.GetEn(this.EnsName);
        Map    map  = en.EnMap;
        string keys = "";

        foreach (Attr attr in map.Attrs)
        {
            if (attr.IsNum == false)
            {
                continue;
            }
            if (attr.IsPK)
            {
                continue;
            }
            if (attr.UIContralType == UIContralType.TB == false)
            {
                continue;
            }
            if (attr.UIVisible == false)
            {
                continue;
            }
            if (attr.MyFieldType == FieldType.FK)
            {
                continue;
            }
            if (attr.MyFieldType == FieldType.Enum)
            {
                continue;
            }
            if (attr.MyFieldType == FieldType.Enum)
            {
                continue;
            }
            if (attr.Key == "OID" || attr.Key == "WorkID" || attr.Key == "MID" || attr.Key == "FID")
            {
                continue;
            }


            string   strs = "@" + attr.Key + "=";
            CheckBox cb   = this.UCSys1.GetCBByID(attr.Key + "_SUM");
            if (cb.Checked)
            {
                strs += ".SUM.";
            }

            cb = this.UCSys1.GetCBByID(attr.Key + "_AVG");
            if (cb.Checked)
            {
                strs += ".AVG.";
            }

            cb = this.UCSys1.GetCBByID(attr.Key + "_AMOUNT");
            if (cb.Checked)
            {
                strs += ".AMOUNT.";
            }

            cb = this.UCSys1.GetCBByID(attr.Key + "_MAX");
            if (cb.Checked)
            {
                strs += ".MAX.";
            }

            cb = this.UCSys1.GetCBByID(attr.Key + "_MIN");
            if (cb.Checked)
            {
                strs += ".MIN.";
            }

            cb = this.UCSys1.GetCBByID(attr.Key + "_LSXS");
            if (cb.Checked)
            {
                strs += ".LSXS.";
            }
            keys += strs;
        }

        BP.Sys.EnCfg cfg = new BP.Sys.EnCfg();
        cfg.No = this.EnsName;
        if (cfg.RetrieveFromDBSources() == 0)
        {
            cfg.Datan = keys;
            cfg.Insert();
        }
        else
        {
            cfg.Datan = keys;
            cfg.Update();
        }
        cfg.Retrieve();
        cfg.Datan = keys;
        this.Alert("设置成功。");
    }