Exemplo n.º 1
0
        /// <summary>
        /// 枚举类型新增保存后在Frm_RB中增加新的枚举值
        /// </summary>
        protected override void afterInsert()
        {
            //获取引用枚举的表单
            string sql = " select  distinct(FK_MapData)from Sys_FrmRB where EnumKey='" + this.EnumKey + "'";

            System.Data.DataTable dt = DBAccess.RunSQLReturnTable(sql);
            if (dt.Rows.Count == 0)
            {
                base.afterInsert();
                return;
            }


            foreach (System.Data.DataRow dr in dt.Rows)
            {
                if (DataType.IsNullOrEmpty(dr[0].ToString()))
                {
                    continue;
                }
                string fk_mapdata = dr[0].ToString();
                string mypk       = fk_mapdata + "_" + this.EnumKey + "_" + this.IntKey;
                FrmRB  frmrb      = new FrmRB();
                if (frmrb.IsExit("MyPK", mypk) == true)
                {
                    frmrb.Lab = this.Lab;
                    frmrb.Update();
                    continue;
                }
                //获取mapAttr
                MapAttr mapAttr     = new MapAttr(fk_mapdata + "_" + this.EnumKey);
                int     RBShowModel = mapAttr.GetParaInt("RBShowModel");
                FrmRB   frmrb1      = new FrmRB(fk_mapdata + "_" + this.EnumKey + "_0");


                frmrb.FK_MapData = fk_mapdata;
                frmrb.KeyOfEn    = this.EnumKey;
                frmrb.EnumKey    = this.EnumKey;
                frmrb.Lab        = this.Lab;
                frmrb.IntKey     = this.IntKey;
                if (RBShowModel == 0)
                {
                    frmrb.X = frmrb1.X;
                    frmrb.Y = frmrb1.Y + 40;
                }
                if (RBShowModel == 3)
                {
                    frmrb.X = frmrb1.X + 100;
                    frmrb.Y = frmrb1.Y;
                }
                frmrb.Insert();
            }

            base.afterInsert();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 保存一个rb
        /// </summary>
        /// <param name="fk_mapdata">表单ID</param>
        /// <param name="ctrlID">控件ID</param>
        /// <param name="x">位置x</param>
        /// <param name="y">位置y</param>
        public static string SaveFrmRadioButton(string fk_mapdata, string ctrlID, float x, float y)
        {
            FrmRB en = new FrmRB();

            en.MyPK = fk_mapdata + "_" + ctrlID;
            int i = en.RetrieveFromDBSources();

            if (i == 0)
            {
                return(null);
            }

            en.FK_MapData = fk_mapdata;
            en.X          = x;
            en.Y          = y;
            en.Update();
            return(en.KeyOfEn);
        }