Example #1
0
        void btn_Del_Click(object sender, EventArgs e)
        {
            try
            {
                // 检查这个类型是否被使用?
                MapAttrs    attrs = new MapAttrs();
                QueryObject qo    = new QueryObject(attrs);
                qo.AddWhere(MapAttrAttr.MyDataType, (int)FieldTypeS.Enum);
                qo.addAnd();
                qo.AddWhere(MapAttrAttr.KeyOfEn, this.RefNo);
                int i = qo.DoQuery();
                if (i == 0)
                {
                    BP.Sys.SysEnums ses = new SysEnums();
                    ses.Delete(BP.Sys.SysEnumAttr.EnumKey, this.RefNo);

                    BP.Sys.SysEnumMain m = new SysEnumMain();
                    m.No = this.RefNo;
                    m.Delete();
                    this.ToMsgPage("删除成功");
                    return;
                }

                string msg = "错误:下列数据已经引用了枚举您不能删除它。";   // "错误:下列数据已经引用了枚举您不能删除它。";
                foreach (MapAttr attr in attrs)
                {
                    msg += "\t\n" + attr.Field + "" + attr.Name + " Table = " + attr.FK_MapData;
                }
                return;
            }
            catch (Exception ex)
            {
                this.ToErrorPage(ex.Message);
            }
        }
Example #2
0
        private void BtnItemSave_Click(object sender, RoutedEventArgs e)
        {
            //TreeListNode item = tvMain.SelectedItem as TreeListNode;
            //if ((item == null) || (item.Tag.ToString() == ""))
            //{
            //    gridItem.ItemsSource = null;
            //    return;
            //}
            //SysEnumMain m_SysEnumMain = item.Tag as SysEnumMain;

            SysEnumMain m_SysEnumMain = tvMain.SelectedItem as SysEnumMain;

            if ((m_SysEnumMain == null) || (string.IsNullOrEmpty(m_SysEnumMain.PKNO)))
            {
                return;
            }

            SysEnumItems m_SysEnumItems = gbItem.DataContext as SysEnumItems;

            if (m_SysEnumItems == null)
            {
                return;
            }

            #region  校验

            if (string.IsNullOrEmpty(m_SysEnumItems.ITEM_NAME))
            {
                Brush oldBrush = this.tbItemName.BorderBrush;
                this.tbItemName.BorderBrush = Brushes.Red;
                System.Windows.Forms.MessageBox.Show("请输入明细名称。", "保存", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.tbItemName.BorderBrush = oldBrush;
                return;
            }

            #endregion

            if (string.IsNullOrEmpty(m_SysEnumItems.PKNO)) //新增
            {
                m_SysEnumItems.PKNO = Guid.NewGuid().ToString("N");

                ws.UseService(s => s.AddSysEnumItems(m_SysEnumItems));

                //重新刷新数据
                List <SysEnumItems> mSysEnumItemses =
                    ws.UseService(s => s.GetSysEnumItemss($"ENUM_IDENTIFY = {m_SysEnumMain.ENUM_IDENTIFY} AND USE_FLAG >= 0"))
                    .OrderBy(c => c.ITEM_INDEX)
                    .ToList();
                gridItem.ItemsSource = mSysEnumItemses;
            }
            else  //修改
            {
                ws.UseService(s => s.UpdateSysEnumItems(m_SysEnumItems));
            }
            //提示保存成功

            gbItem.IsCollapsed = true;
            gbItem.Visibility  = Visibility.Collapsed;
            BindHelper.SetDictDataBindingGridItem(gbItem, gridItem);
        }
Example #3
0
        private void BtnItemAdd_Click(object sender, RoutedEventArgs e)
        {
            //TreeListNode item = tvMain.SelectedItem as TreeListNode;
            //if ((item == null) || (item.Tag.ToString() == ""))
            //{
            //    gridItem.ItemsSource = null;
            //    return;
            //}
            //SysEnumMain m_SysEnumMain = item.Tag as SysEnumMain;

            SysEnumMain m_SysEnumMain = tvMain.SelectedItem as SysEnumMain;

            if ((m_SysEnumMain == null) || (string.IsNullOrEmpty(m_SysEnumMain.PKNO)))
            {
                return;
            }

            if (CBaseData.LoginNO != CBaseData.ADMINPKNO)
            {
                if ((m_SysEnumMain.ENUM_STATE == 2) || (m_SysEnumMain.ENUM_STATE == 3))
                {
                    System.Windows.Forms.MessageBox.Show("非管理员不能更改该基础信息明细信息", "维护明细信息", MessageBoxButtons.OK,
                                                         MessageBoxIcon.Information);
                    return;
                }
            }

            #region 动画效果

            //dictBasic.Header = "基础信息明细项  【新增】";
            //TranslateTransform tt = new TranslateTransform();
            //DoubleAnimation da = new DoubleAnimation();
            ////动画时间
            //Duration duration = new Duration(TimeSpan.FromSeconds(1));
            ////设置按钮的转换效果
            //gbItem.RenderTransform = tt;
            //tt.Y = 200;
            //da.To = 0;
            //da.SpeedRatio = 1.3;
            //da.By = 0.5;
            //// da.Duration = duration;
            //tt.BeginAnimation(TranslateTransform.YProperty, da);

            #endregion

            //添加明细
            dictBasic.Header   = "基础信息明细项  【新增】";
            gbItem.IsCollapsed = false;
            gbItem.Visibility  = Visibility.Visible;

            SysEnumItems m_SysEnumItems = new SysEnumItems()
            {
                COMPANY_CODE  = "",
                ENUM_IDENTIFY = m_SysEnumMain.ENUM_IDENTIFY,  //基础信息标识
                ITEM_INDEX    = gridItem.VisibleRowCount,
                ITEM_TYPE     = 0,
                USE_FLAG      = 1,
            };
            gbItem.DataContext = m_SysEnumItems;
        }
Example #4
0
        private void BtnItemMod_Click(object sender, RoutedEventArgs e)
        {
            //TreeListNode item = tvMain.SelectedItem as TreeListNode;
            //if ((item == null) || (item.Tag.ToString() == ""))
            //{
            //    gridItem.ItemsSource = null;
            //    return;
            //}
            //SysEnumMain m_SysEnumMain = item.Tag as SysEnumMain;

            SysEnumMain m_SysEnumMain = tvMain.SelectedItem as SysEnumMain;

            if ((m_SysEnumMain == null) || (string.IsNullOrEmpty(m_SysEnumMain.PKNO)))
            {
                return;
            }

            if (gridItem.SelectedItem == null)
            {
                return;
            }
            if (CBaseData.LoginNO != CBaseData.ADMINPKNO)
            {
                if ((m_SysEnumMain.ENUM_STATE == 2) || (m_SysEnumMain.ENUM_STATE == 3))
                {
                    System.Windows.Forms.MessageBox.Show("非管理员不能更改该基础信息明细信息", "维护明细信息", MessageBoxButtons.OK,
                                                         MessageBoxIcon.Information);
                    return;
                }
            }
            //修改明细
            dictBasic.Header   = "基础信息明细项  【修改】";
            gbItem.IsCollapsed = false;
            gbItem.Visibility  = Visibility.Visible;
        }
Example #5
0
        private void BtnMainMod_Click(object sender, RoutedEventArgs e)
        {
            //TreeListNode item = tvMain.SelectedItem as TreeListNode;
            //if ((item == null) || (item.Tag.ToString() == ""))
            //{
            //    gridItem.ItemsSource = null;
            //    return;
            //}
            //SysEnumMain m_SysEnumMain = item.Tag as SysEnumMain;

            SysEnumMain m_SysEnumMain = tvMain.SelectedItem as SysEnumMain;

            if ((m_SysEnumMain == null) || (string.IsNullOrEmpty(m_SysEnumMain.PKNO)))
            {
                return;
            }

            if (CBaseData.LoginNO != CBaseData.ADMINPKNO)
            {
                if (m_SysEnumMain.ENUM_STATE != 0)
                {
                    System.Windows.Forms.MessageBox.Show("非管理员不能更改该基础信息主信息", "维护主信息", MessageBoxButtons.OK,
                                                         MessageBoxIcon.Information);
                    return;
                }
            }

            EnumMainEdit mainEdit = new EnumMainEdit(m_SysEnumMain);

            mainEdit.ShowDialog();

            GetMainData();
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //this.Response.Write(this.Request.RawUrl);
            this.Title = "编辑枚举类型"; // "编辑枚举类型";
            MapAttr attr = null;

            if (this.RefNo == null)
            {
                attr = new MapAttr();
                string enumKey = this.Request.QueryString["EnumKey"];
                if (enumKey != null)
                {
                    SysEnumMain se = new SysEnumMain(enumKey);
                    attr.KeyOfEn   = enumKey;
                    attr.UIBindKey = enumKey;
                    attr.Name      = se.Name;
                    attr.Name      = se.Name;
                }
            }
            else
            {
                attr = new MapAttr(this.RefNo);
            }
            BindEnum(attr);
        }
Example #7
0
 public SysEnumMain GetSysEnumMainById(string Id)
 {
     using (ISysEnumMainBLL SysEnumMainBLL = BLLContainer.Resolve <ISysEnumMainBLL>())
     {
         SysEnumMain model = SysEnumMainBLL.GetFirstOrDefault(Id);
         return(model);
     }
 }
Example #8
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            SysEnumMain main = cmbBasic.SelectedItem as SysEnumMain;

            if (main == null)
            {
                return;
            }
            cmbTest.EnumIdentify = main.ENUM_IDENTIFY;
        }
Example #9
0
 public bool AddSysEnumMain(SysEnumMain mSysEnumMain)
 {
     if (mSysEnumMain == null)
     {
         return(false);
     }
     using (ISysEnumMainBLL SysEnumMainBLL = BLLContainer.Resolve <ISysEnumMainBLL>())
     {
         return(SysEnumMainBLL.Add(mSysEnumMain));
     }
 }
Example #10
0
 public bool DelSysEnumMain(string Id)
 {
     using (ISysEnumMainBLL SysEnumMainBLL = BLLContainer.Resolve <ISysEnumMainBLL>())
     {
         try
         {
             SysEnumMain item = SysEnumMainBLL.GetFirstOrDefault(Id);
             return(SysEnumMainBLL.Delete(item));
         }
         catch { return(false); }
     }
 }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SysEnumMain main = new SysEnumMain();

            if (this.RefNo != null)
            {
                main.No = this.RefNo;
                main    = new SysEnumMain(this.RefNo);
                // main.Retrieve();
            }
            this.BindSysEnum(main);
        }
Example #12
0
    void btn_Click(object sender, EventArgs e)
    {
        //原有个数
        SysEnums souceSes = new SysEnums();

        souceSes.Retrieve(SysEnumAttr.EnumKey, this.RefNo, SysEnumAttr.IntKey);

        SysEnums ses = new SysEnums();

        for (int i = 0; i < souceSes.Count + 10; i++)
        {
            TextBox tb = this.UCSys1.GetTextBoxByID("TB_" + i);
            if (tb == null)
            {
                continue;
            }
            if (string.IsNullOrEmpty(tb.Text))
            {
                continue;
            }

            SysEnum se = new SysEnum();
            se.IntKey  = i;
            se.Lab     = tb.Text.Trim();
            se.Lang    = BP.Web.WebUser.SysLang;
            se.EnumKey = this.RefNo;
            se.MyPK    = se.EnumKey + "_" + se.Lang + "_" + se.IntKey;
            ses.AddEntity(se);
        }

        if (ses.Count == 0)
        {
            this.Alert("枚举项目不能为空.");
            return;
        }

        ses.Delete(SysEnumAttr.EnumKey, this.RefNo);

        string lab = "";

        foreach (SysEnum se in ses)
        {
            se.Save();
            lab += "@" + se.IntKey + "=" + se.Lab;
        }
        SysEnumMain main = new SysEnumMain(this.RefNo);

        main.Name   = UCSys1.GetTextBoxByID("TB_Name").Text;
        main.CfgVal = lab;
        main.Update();
        this.Alert("保存成功.");
    }
Example #13
0
        //删除主信息,已禁用
        private void BtnMainDel_Click(object sender, RoutedEventArgs e)
        {
            if (this.tvMain.SelectedItem != null)
            {
                SysEnumMain m_SysEnumMain = this.tvMain.SelectedItem as SysEnumMain;
                if (m_SysEnumMain == null)
                {
                    return;
                }

                ws.UseService(s => s.DelSysEnumMain(m_SysEnumMain.PKNO));
            }
        }
Example #14
0
        private void BtnItemDel_Click(object sender, RoutedEventArgs e)
        {
            //TreeListNode item = tvMain.SelectedItem as TreeListNode;
            //if ((item == null) || (item.Tag.ToString() == ""))
            //{
            //    gridItem.ItemsSource = null;
            //    return;
            //}
            //SysEnumMain m_SysEnumMain = item.Tag as SysEnumMain;

            SysEnumMain m_SysEnumMain = tvMain.SelectedItem as SysEnumMain;

            if ((m_SysEnumMain == null) || (string.IsNullOrEmpty(m_SysEnumMain.PKNO)))
            {
                return;
            }
            if (CBaseData.LoginNO != CBaseData.ADMINPKNO)
            {
                if ((m_SysEnumMain.ENUM_STATE == 2) || (m_SysEnumMain.ENUM_STATE == 3))
                {
                    System.Windows.Forms.MessageBox.Show("非管理员不能更改该基础信息明细信息", "维护明细信息", MessageBoxButtons.OK,
                                                         MessageBoxIcon.Information);
                    return;
                }
            }
            //删除明细
            SysEnumItems m_SysEnumItems = gridItem.SelectedItem as SysEnumItems;

            if (m_SysEnumItems == null)
            {
                return;
            }

            if (System.Windows.Forms.MessageBox.Show($"确定删除基础信息【{m_SysEnumItems.ITEM_NAME}】吗?",
                                                     @"删除信息",
                                                     MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                ws.UseService(s => s.DelSysEnumItems(m_SysEnumItems.PKNO));

                //删除成功.
                List <SysEnumItems> mSysEnumItemses =
                    ws.UseService(s => s.GetSysEnumItemss($"ENUM_IDENTIFY = {m_SysEnumMain.ENUM_IDENTIFY} AND USE_FLAG >= 0"))
                    .OrderBy(c => c.ITEM_INDEX)
                    .ToList();
                gridItem.ItemsSource = mSysEnumItemses;

                BindHelper.SetDictDataBindingGridItem(gbItem, gridItem);
            }
        }
Example #15
0
        private void BtnMainAdd_Click(object sender, RoutedEventArgs e)
        {
            SysEnumMain main = new SysEnumMain()
            {
                PKNO         = "",
                COMPANY_CODE = "",
                ENUM_TYPE    = 0,
                VALUE_FIELD  = 0,
                USE_FLAG     = 0,
            };
            EnumMainEdit mainEdit = new EnumMainEdit(main);

            mainEdit.ShowDialog();

            GetMainData();
        }
Example #16
0
        private void BtnRefresh_Click(object sender, ItemClickEventArgs e)
        {
            //重新刷新数据
            SysEnumMain m_SysEnumMain = tvMain.SelectedItem as SysEnumMain;

            if ((m_SysEnumMain == null) || (string.IsNullOrEmpty(m_SysEnumMain.PKNO)))
            {
                return;
            }
            List <SysEnumItems> mSysEnumItemses =
                ws.UseService(s => s.GetSysEnumItemss($"ENUM_IDENTIFY = {m_SysEnumMain.ENUM_IDENTIFY} AND USE_FLAG >= 0"))
                .OrderBy(c => c.ITEM_INDEX)
                .ToList();

            gridItem.ItemsSource = mSysEnumItemses;
        }
Example #17
0
        public EnumMainEdit(SysEnumMain enumMain)
        {
            InitializeComponent();

            if (enumMain == null)
            {
                enumMain = new SysEnumMain()
                {
                    PKNO         = "",
                    COMPANY_CODE = "",
                    ENUM_TYPE    = 0,
                    VALUE_FIELD  = 0,
                    USE_FLAG     = 0,
                };
            }
            gbInfo.DataContext = enumMain;
        }
Example #18
0
 public bool DelSysEnumMains(string[] Ids)
 {
     using (ISysEnumMainBLL SysEnumMainBLL = BLLContainer.Resolve <ISysEnumMainBLL>())
     {
         try
         {
             List <SysEnumMain> entitys = new List <SysEnumMain>();
             foreach (string id in Ids)
             {
                 SysEnumMain item = SysEnumMainBLL.GetFirstOrDefault(id);
                 entitys.Add(item);
             }
             return(SysEnumMainBLL.Delete(entitys));
         }
         catch { return(false); }
     }
 }
Example #19
0
        //双击修改
        private void gridItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            SysEnumMain m_SysEnumMain = tvMain.SelectedItem as SysEnumMain;

            if ((m_SysEnumMain == null) || (string.IsNullOrEmpty(m_SysEnumMain.PKNO)))
            {
                return;
            }

            if (gridItem.SelectedItem == null)
            {
                return;
            }
            //修改明细
            dictBasic.Header   = "基础信息明细项  【修改】";
            gbItem.IsCollapsed = false;
            gbItem.Visibility  = Visibility.Visible;
        }
Example #20
0
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            SysEnumMain main = gbInfo.DataContext as SysEnumMain;

            if (string.IsNullOrEmpty(main.PKNO))  //新增
            {
                main.PKNO             = Guid.NewGuid().ToString("N");
                main.CREATION_DATE    = DateTime.Now;
                main.CREATED_BY       = CBaseData.LoginName;
                main.LAST_UPDATE_DATE = DateTime.Now;
                ws.UseService(s => s.AddSysEnumMain(main));
            }
            else
            {
                main.UPDATED_BY       = CBaseData.LoginName;
                main.LAST_UPDATE_DATE = DateTime.Now;
                ws.UseService(s => s.UpdateSysEnumMain(main));
            }

            Close();
        }
Example #21
0
        public string SaveEnum(string enumKey, string enumLab, string cfg)
        {
            SysEnumMain sem = new SysEnumMain();

            sem.No = enumKey;
            if (sem.RetrieveFromDBSources() == 0)
            {
                sem.Name   = enumLab;
                sem.CfgVal = cfg;
                sem.Lang   = WebUser.SysLang;
                sem.Insert();
            }
            else
            {
                sem.Name   = enumLab;
                sem.CfgVal = cfg;
                sem.Lang   = WebUser.SysLang;
                sem.Update();
            }

            string[] strs = cfg.Split('@');
            foreach (string str in strs)
            {
                if (string.IsNullOrEmpty(str))
                {
                    continue;
                }
                string[] kvs = str.Split('=');
                SysEnum  se  = new SysEnum();
                se.EnumKey = enumKey;
                se.Lang    = WebUser.SysLang;
                se.IntKey  = int.Parse(kvs[0]);
                se.Lab     = kvs[1];
                se.Insert();
            }
            return("save ok.");
        }
Example #22
0
        private void tvMain_SelectedItemChanged(object sender, SelectedItemChangedEventArgs e)
        {
            //TreeListNode item = tvMain.SelectedItem as TreeListNode;
            //if ((item == null) || (item.Tag.ToString() == ""))
            //{
            //    gridItem.ItemsSource = null;
            //    return;
            //}
            //SysEnumMain m_SysEnumMain = item.Tag as SysEnumMain;

            SysEnumMain m_SysEnumMain = tvMain.SelectedItem as SysEnumMain;

            if ((m_SysEnumMain == null) || (string.IsNullOrEmpty(m_SysEnumMain.PKNO)))
            {
                gridItem.ItemsSource = null;
                return;
            }
            if (string.IsNullOrEmpty(m_SysEnumMain.ENUM_CODE_INFO))
            {
                this.lbCodeName.Label    = "代号";
                this.gridCodeName.Header = "代号";
                this.lbCodeIntrod.Text   = "";
            }
            else
            {
                this.lbCodeName.Label    = m_SysEnumMain.ENUM_CODE_INFO;
                this.gridCodeName.Header = m_SysEnumMain.ENUM_CODE_INFO;
                this.lbCodeIntrod.Text   = m_SysEnumMain.ENUM_CODE_INTROD;
            }

            List <SysEnumItems> mSysEnumItemses =
                ws.UseService(s => s.GetSysEnumItemss($"ENUM_IDENTIFY = {m_SysEnumMain.ENUM_IDENTIFY} AND USE_FLAG >= 0"))
                .OrderBy(c => c.ITEM_INDEX)
                .ToList();

            gridItem.ItemsSource = mSysEnumItemses;
        }
Example #23
0
        public void BindSysEnum(SysEnumMain en)
        {
            SysEnums ses = new SysEnums();

            if (en.No.Length > 0)
            {
                //ses = new SysEnums(en.No);
                ses.Retrieve(SysEnumAttr.EnumKey, en.No);
            }

            this.Pub1.AddTable();
            if (this.RefNo == null)
            {
                this.Pub1.AddCaptionLeft("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>增加新字段向导</a> - <a href='Do.aspx?DoType=AddSysEnum&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>枚举字段</a> - 新建");
            }
            else
            {
                this.Pub1.AddCaptionLeft("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>增加新字段向导</a> - <a href='Do.aspx?DoType=AddSysEnum&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>枚举字段</a> - 编辑");
            }

            if (this.RefNo == null)
            {
                this.Title = "新建枚举";
            }
            else
            {
                this.Title = "编辑枚举类型";
            }


            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("&nbsp;");
            this.Pub1.AddTDTitle("&nbsp;");
            this.Pub1.AddTDTitle("备注");
            this.Pub1.AddTREnd();

            this.Pub1.AddTRSum();
            this.Pub1.AddTD("编号");
            BP.Web.Controls.TB tb = new BP.Web.Controls.TB();
            tb.ID   = "TB_No";
            tb.Text = en.No;
            if (this.RefNo == null)
            {
                tb.Enabled = true;
            }
            else
            {
                tb.Enabled = false;
            }

            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("枚举英文名称");
            this.Pub1.AddTREnd();


            this.Pub1.AddTRSum();
            this.Pub1.AddTD("名称");
            tb      = new BP.Web.Controls.TB();
            tb.ID   = "TB_Name";
            tb.Text = en.Name;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("枚举中文名称");
            this.Pub1.AddTREnd();

            int idx = 0;

            while (idx < 20)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);
                tb    = new BP.Web.Controls.TB();
                tb.ID = "TB_" + idx;
                SysEnum se = ses.GetEntityByKey(SysEnumAttr.IntKey, idx) as SysEnum;
                if (se != null)
                {
                    tb.Text = se.Lab;
                }
                //   tb.Text = en.Name;
                this.Pub1.AddTD(tb);
                this.Pub1.AddTD("");
                this.Pub1.AddTREnd();
                idx++;
            }

            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD colspan=3 align=center>");
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保存 ";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.CssClass = "Btn";
            btn.ID       = "Btn_Add";
            btn.Text     = "添加到表单"; // "添加到表单";
            btn.Attributes["onclick"] = " return confirm('您确认吗?');";
            btn.Click += new EventHandler(btn_Add_Click);
            if (this.RefNo == null)
            {
                btn.Enabled = false;
            }
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.CssClass = "Btn";
            btn.ID       = "Btn_Del";
            btn.Text     = " 删除 ";
            btn.Attributes["onclick"] = " return confirm('您确认吗?');";
            if (this.RefNo == null)
            {
                btn.Enabled = false;
            }

            btn.Click += new EventHandler(btn_Del_Click);
            this.Pub1.Add(btn);

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Example #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = "枚举值编辑";
        if (this.DoType == "Del")
        {
            MapAttrs attrs = new MapAttrs();
            attrs.Retrieve(MapAttrAttr.UIBindKey, this.RefNo);
            if (attrs.Count != 0)
            {
                this.UCSys1.AddFieldSet("<a href='EnumList.aspx' ><img src='./../../Img/Btn/Home.gif' border=0/>返回列表</a> - 删除确认");
                this.UCSys1.Add("此枚举值已经被其它的字段所引用,您不能删除它。");
                this.UCSys1.AddH2("<a href='EnumList.aspx' >返回列表</a>");
                this.UCSys1.AddFieldSetEnd();
                return;
            }

            this.UCSys1.AddFieldSet("<a href='EnumList.aspx' ><img src='./../../Img/Btn/Home.gif' border=0/>返回列表</a> - 删除确认");
            SysEnumMain m = new SysEnumMain(this.RefNo);
            this.UCSys1.AddH2("<a href='EnumList.aspx?RefNo=" + this.RefNo + "&DoType=DelReal' >删除:" + m.Name + " 确认.</a>");
            this.UCSys1.AddFieldSetEnd();
            return;
        }

        if (this.DoType == "DelReal")
        {
            SysEnumMain m = new SysEnumMain();
            m.No = this.RefNo;
            m.Delete();
            SysEnums ses = new SysEnums();
            ses.Delete(SysEnumAttr.EnumKey, this.RefNo);
            this.Response.Redirect("EnumList.aspx", true);
            return;
        }

        if (this.DoType == "New")
        {
            this.BindNew();
            return;
        }

        if (this.RefNo != null)
        {
            this.BindRefNo();
            return;
        }

        this.UCSys1.AddTable();
        this.UCSys1.AddCaptionLeftTX("<img src='./../../Img/Btn/Home.gif' border=0/>列表 - <a href='EnumList.aspx?DoType=New' ><img border=0 src='./../../Img/Btn/New.gif' >新建</a>");
        this.UCSys1.AddTR();
        this.UCSys1.AddTDTitle("序");
        this.UCSys1.AddTDTitle("编号");
        this.UCSys1.AddTDTitle("名称");
        this.UCSys1.AddTDTitle("信息");
        this.UCSys1.AddTDTitle("操作");
        this.UCSys1.AddTREnd();

        SysEnumMains sems = new SysEnumMains();

        sems.RetrieveAll();
        int i = 0;

        foreach (SysEnumMain se in sems)
        {
            i++;
            this.UCSys1.AddTR();
            this.UCSys1.AddTDIdx(i);
            this.UCSys1.AddTD(se.No);
            this.UCSys1.AddTDA("EnumList.aspx?RefNo=" + se.No, se.Name);
            this.UCSys1.AddTD(se.CfgVal);
            this.UCSys1.AddTDA("EnumList.aspx?RefNo=" + se.No + "&DoType=Del", "<img src='./../../Img/Btn/Delete.gif' border=0 />删除");
            this.UCSys1.AddTREnd();
        }
        this.UCSys1.AddTableEnd();
    }
Example #25
0
        void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                SysEnumMain main = new SysEnumMain();
                if (this.RefNo == null)
                {
                    main.No = this.Pub1.GetTBByID("TB_No").Text;
                    if (main.IsExits)
                    {
                        //this.Alert("编号(枚举英文名称)[" + main.No + "]已经存在。");
                        this.Alert("编号(枚举英文名称)[" + main.No + "]已经存在。");
                        return;
                    }

                    SysEnum se = new SysEnum();
                    if (se.IsExit(SysEnumAttr.EnumKey, main.No) == true)
                    {
                        this.Alert("编号(枚举英文名称)[" + main.No + "]已经存在。");
                        return;
                    }

                    main = (SysEnumMain)this.Pub1.Copy(main);
                    if (main.No.Length == 0 || main.Name.Length == 0)
                    {
                        throw new Exception("编号与名称不能为空");
                    }
                }
                else
                {
                    main.No = this.RefNo;
                    main.Retrieve();
                    main = (SysEnumMain)this.Pub1.Copy(main);
                    if (main.No.Length == 0 || main.Name.Length == 0)
                    {
                        throw new Exception("编号与名称不能为空");
                    }
                }

                string cfgVal = "";
                int    idx    = -1;
                while (idx < 19)
                {
                    idx++;
                    string t = this.Pub1.GetTBByID("TB_" + idx).Text.Trim();
                    if (t.Length == 0)
                    {
                        continue;
                    }

                    cfgVal += "@" + idx + "=" + t;
                }

                main.CfgVal = cfgVal;
                if (main.CfgVal == "")
                {
                    throw new Exception("错误:您必须输入枚举值,请参考帮助。");  //错误:您必须输入枚举值,请参考帮助。
                }
                main.Save();

                //重新生成
                SysEnums se1s = new SysEnums();
                se1s.Delete(SysEnumAttr.EnumKey, main.No);
                SysEnums ses = new SysEnums();
                ses.RegIt(main.No, cfgVal);

                string keyApp = "EnumOf" + main.No + WebUser.SysLang;
                BP.DA.Cash.DelObjFormApplication(keyApp);

                if (this.MyPK != null)
                {
                    this.Response.Redirect("SysEnum.aspx?RefNo=" + main.No + "&MyPK=" + this.MyPK + "&IDX=" + this.IDX, true);
                }
                return;
            }
            catch (Exception ex)
            {
                this.ResponseWriteBlueMsg(ex.Message);
                //this.ToErrorPage(ex.Message);
                //this.Alert(ex.Message);
            }
        }
Example #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = "枚举值编辑";
        if (this.DoType == "Del")
        {
            MapAttrs attrs = new MapAttrs();
            attrs.Retrieve(MapAttrAttr.UIBindKey, this.RefNo);

            this.UCSys1.AddEasyUiPanelInfoBegin("删除确认", "icon-delete");

            if (attrs.Count != 0)
            {
                //this.UCSys1.AddFieldSet("<a href='EnumList.aspx' ><img src='./../../Img/Btn/Home.gif' border=0/>返回列表</a> - 删除确认");
                //this.UCSys1.Add("此枚举值已经被其它的字段所引用,您不能删除它。");
                //this.UCSys1.AddH2("<a href='EnumList.aspx' >返回列表</a>");
                //this.UCSys1.AddFieldSetEnd();
                this.UCSys1.Add("<b>此枚举值已经被其它的字段所引用,您不能删除它。</b>");
                this.UCSys1.Add("<a class='easyui-linkbutton' data-options=\"iconCls:'icon-back'\" href='EnumList.aspx?T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "' >返回列表</a>");
                this.UCSys1.AddEasyUiPanelInfoEnd();
                return;
            }

            //this.UCSys1.AddFieldSet("<a href='EnumList.aspx' ><img src='./../../Img/Btn/Home.gif' border=0/>返回列表</a> - 删除确认");
            SysEnumMain m = new SysEnumMain(this.RefNo);
            this.UCSys1.AddEasyUiLinkButton("确定删除:" + m.Name + "?", "EnumList.aspx?RefNo=" + this.RefNo + "&DoType=DelReal&T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff"),
                                            "icon-delete");
            this.UCSys1.AddSpace(1);
            this.UCSys1.AddEasyUiLinkButton("取消", "EnumList.aspx?T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff"),
                                            "icon-undo");
            this.UCSys1.AddEasyUiPanelInfoEnd();
            return;
        }

        if (this.DoType == "DelReal")
        {
            SysEnumMain m = new SysEnumMain();
            m.No = this.RefNo;
            m.Delete();
            SysEnums ses = new SysEnums();
            ses.Delete(SysEnumAttr.EnumKey, this.RefNo);
            //this.Response.Redirect("EnumList.aspx", true);
            this.Response.Redirect("EnumList.aspx?T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff"), true);
            return;
        }

        if (this.DoType == "New")
        {
            this.BindNew();
            return;
        }

        if (this.RefNo != null)
        {
            this.BindRefNo();
            return;
        }

        //this.UCSys1.AddTable();
        //this.UCSys1.AddCaptionLeftTX("<img src='./../../Img/Btn/Home.gif' border=0/>列表 - <a href='EnumList.aspx?DoType=New' ><img border=0 src='./../../Img/Btn/New.gif' >新建</a>");
        this.UCSys1.AddTableNormal();
        this.UCSys1.AddTRGroupTitle(5,
                                    "<b>列表</b> - <a href='EnumList.aspx?DoType=New&T=" +
                                    DateTime.Now.ToString("yyyyMMddHHmmssfff") +
                                    "'>新建</a>");
        this.UCSys1.AddTR();
        this.UCSys1.AddTDGroupTitleCenter("序");
        this.UCSys1.AddTDGroupTitle("编号");
        this.UCSys1.AddTDGroupTitle("名称");
        this.UCSys1.AddTDGroupTitle("信息");
        this.UCSys1.AddTDGroupTitle("操作");
        this.UCSys1.AddTREnd();

        SysEnumMains sems = new SysEnumMains();

        sems.RetrieveAll();
        int i = 0;

        foreach (SysEnumMain se in sems)
        {
            i++;
            //this.UCSys1.AddTR();
            this.UCSys1.AddTR(i % 2 == 0);
            this.UCSys1.AddTDIdx(i);
            this.UCSys1.AddTD(se.No);
            this.UCSys1.AddTDA("EnumList.aspx?RefNo=" + se.No + "&T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff"), se.Name);
            this.UCSys1.AddTD(se.CfgVal);
            //this.UCSys1.AddTDA("EnumList.aspx?RefNo=" + se.No + "&DoType=Del", "<img src='./../../Img/Btn/Delete.gif' border=0 />删除");
            this.UCSys1.AddTDBegin();
            this.UCSys1.AddEasyUiLinkButton("删除", "EnumList.aspx?RefNo=" + se.No + "&DoType=Del&T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff"), "icon-delete");
            this.UCSys1.AddTDEnd();
            this.UCSys1.AddTREnd();
        }
        this.UCSys1.AddTableEnd();
    }
Example #27
0
    void btn_New_Click(object sender, EventArgs e)
    {
        string      no   = this.UCSys1.GetTextBoxByID("TB_No").Text;
        string      name = this.UCSys1.GetTextBoxByID("TB_Name").Text;
        SysEnumMain m    = new SysEnumMain();

        m.No = no;
        if (m.RetrieveFromDBSources() == 1)
        {
            this.Alert("枚举编号:" + m.No + " 已经被:" + m.Name + "占用");
            return;
        }
        m.Name = name;
        if (string.IsNullOrEmpty(name))
        {
            this.Alert("枚举名称不能为空");
            return;
        }

        SysEnums ses = new SysEnums();

        for (int i = 0; i < 20; i++)
        {
            TextBox tb = this.UCSys1.GetTextBoxByID("TB_" + i);
            if (tb == null)
            {
                continue;
            }
            if (string.IsNullOrEmpty(tb.Text))
            {
                continue;
            }

            SysEnum se = new SysEnum();
            se.IntKey  = i;
            se.Lab     = tb.Text.Trim();
            se.Lang    = BP.Web.WebUser.SysLang;
            se.EnumKey = m.No;
            se.MyPK    = se.EnumKey + "_" + se.Lang + "_" + se.IntKey;
            ses.AddEntity(se);
        }

        if (ses.Count == 0)
        {
            this.Alert("枚举项目不能为空.");
            return;
        }

        string lab = "";

        foreach (SysEnum se in ses)
        {
            se.Save();
            lab += "@" + se.IntKey + "=" + se.Lab;
        }

        m.Lang   = BP.Web.WebUser.SysLang;
        m.CfgVal = lab;
        m.Insert();
        this.Response.Redirect("EnumList.aspx?RefNo=" + m.No + "&T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff"), true);
    }
Example #28
0
        //外键表名称;关联外键表字段;外键表显示字段名
        private string GetValueByTableField(string[] parameters, string sValue)
        {
            string sText = sValue;

            #region 枚举类转化

            if ((parameters.Length == 1) && (parameters[0].Contains(":") || parameters[0].Contains(":"))) //单一长度
            {
                string[] enuminfos = parameters[0].Split('|');
                foreach (var str in enuminfos)
                {
                    string[] s = str.Split(':', ':');
                    if (s.Count() < 2)
                    {
                        continue;
                    }
                    if (sValue == s[0])
                    {
                        sText = s[1];
                    }
                }
                return(sText);
            }

            #endregion

            if (parameters.Length < 1)
            {
                return(sValue);
            }

            string sTableName = parameters[0];  //表名
            if ((sTableName != "基础信息") && (parameters.Length < 3))
            {
                return(sValue);
            }
            string sWhereField = parameters[1];
            string sFieldName  = parameters[2]; //parameters.Count() >= 3 ? parameters[2] : "";

            if (string.IsNullOrEmpty(sWhereField) && (!string.IsNullOrEmpty(sFieldName)))
            {
                sWhereField = sFieldName;
            }
            if (string.IsNullOrEmpty(sTableName) || string.IsNullOrEmpty(sWhereField))
            {
                return(sValue);
            }

            if (sTableName == "基础信息") //
            {
                WcfClient <ISDMService> ws2 = new WcfClient <ISDMService>();

                #region 获取基础信息数据

                SysEnumMain         main  = ws2.UseService(s => s.GetSysEnumMains($"ENUM_IDENTIFY = '{sWhereField}'")).FirstOrDefault();
                List <SysEnumItems> items = ws2.UseService(s => s.GetSysEnumItemss($"ENUM_IDENTIFY = '{sWhereField}'"))
                                            .OrderBy(c => c.ITEM_INDEX)
                                            .ToList();

                if ((main != null) && (items.Count > 0))
                {
                    switch (main.VALUE_FIELD)
                    {
                    case 1:      //编号
                        sText = items.FirstOrDefault(c => c.ITEM_NO == sValue)?.ITEM_NAME;
                        break;

                    case 2:      //代码
                        sText = items.FirstOrDefault(c => c.ITEM_CODE == sValue)?.ITEM_NAME;
                        break;

                    case 3:      //PKNO
                        sText = items.FirstOrDefault(c => c.PKNO == sValue)?.ITEM_NAME;
                        break;

                    default:      //名称
                        sText = items.FirstOrDefault(c => c.ITEM_NAME == sValue)?.ITEM_NAME;
                        break;
                    }
                }

                #endregion
            }
            else
            {
                WcfClient <ISQLService> ws = new WcfClient <ISQLService>();

                sText = ws.UseService(
                    s =>
                    s.GetScalar($"SELECT {sFieldName} FROM {sTableName} WHERE {sWhereField} = '{sValue}'",
                                new List <string>(), new List <string>()));
            }

            if (string.IsNullOrEmpty(sText))
            {
                sText = sValue;
            }

            if (parameters.Count() > 3)
            {
                List <string> newParameters = new List <string>();

                for (int i = 3; i < parameters.Length; i++)
                {
                    newParameters.Add(parameters[i]);
                }

                sText = GetValueByTableField(newParameters.ToArray(), sText);
            }
            return(sText);
        }
Example #29
0
    public void BindRefNo()
    {
        SysEnumMain sem = new SysEnumMain(this.RefNo);

        this.UCSys1.AddTableNormal();
        this.UCSys1.AddTRGroupTitle(3,
                                    "<a href='EnumList.aspx?T=" +
                                    DateTime.Now.ToString("yyyyMMddHHmmssfff") +
                                    "'>列表</a> - <a href='EnumList.aspx?DoType=New&T=" +
                                    DateTime.Now.ToString("yyyyMMddHHmmssfff") +
                                    "'>新建</a> - 编辑:<b>" + sem.Name + "</b>");

        this.UCSys1.AddTR();
        LinkBtn btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

        btn.Click += new EventHandler(btn_Click);
        this.UCSys1.AddTDGroupTitle("colspan=3", btn);
        this.UCSys1.AddTREnd();

        this.UCSys1.AddTR();
        // this.UCSys1.AddTDTitle("序");
        this.UCSys1.AddTDGroupTitle("项目");
        this.UCSys1.AddTDGroupTitle("采集");
        this.UCSys1.AddTDGroupTitle("说明");
        this.UCSys1.AddTREnd();

        SysEnums ses = new SysEnums();

        ses.Retrieve(SysEnumAttr.EnumKey, this.RefNo, SysEnumAttr.IntKey);

        this.UCSys1.AddTRSum();
        this.UCSys1.AddTD("style='text-align:right; width:60px'", "编号");
        TextBox tb = new TextBox();

        tb.ID      = "TB_No";
        tb.Text    = this.RefNo;
        tb.Enabled = false;
        this.UCSys1.AddTD(tb);
        this.UCSys1.AddTD("不可修改");
        this.UCSys1.AddTREnd();

        this.UCSys1.AddTRSum();
        this.UCSys1.AddTD("style='text-align:right; width:60px'", "名称");
        tb      = new TextBox();
        tb.ID   = "TB_Name";
        tb.Text = sem.Name;
        this.UCSys1.AddTD(tb);
        this.UCSys1.AddTD("");
        this.UCSys1.AddTREnd();

        int myNum = 0;

        foreach (SysEnum se in ses)
        {
            this.UCSys1.AddTR();
            this.UCSys1.AddTD(se.IntKey);
            tb         = new TextBox();
            tb.ID      = "TB_" + se.IntKey;
            tb.Text    = se.Lab;
            tb.Columns = 50;
            this.UCSys1.AddTD(tb);
            this.UCSys1.AddTD("");
            this.UCSys1.AddTREnd();
            myNum = se.IntKey;
        }

        myNum++;
        //每次追加10个
        for (int i = myNum; i < 10 + myNum; i++)
        {
            this.UCSys1.AddTR();
            this.UCSys1.AddTD(i);
            tb         = new TextBox();
            tb.ID      = "TB_" + i;
            tb.Columns = 50;
            this.UCSys1.AddTD(tb);
            this.UCSys1.AddTD("");
            this.UCSys1.AddTREnd();
        }
        this.UCSys1.AddTableEnd();
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                switch (this.DoType)
                {
                case "DownTempFrm":
                    MapData md   = new MapData(this.FK_MapData);
                    DataSet ds   = md.GenerHisDataSet();
                    string  name = "ccflow表单模板." + md.Name + "." + md.No + ".xml";
                    string  file = this.Request.PhysicalApplicationPath + "\\Temp\\" + this.FK_MapData + ".xml";
                    ds.WriteXml(file);
                    this.Response.Redirect("../../Temp/" + this.FK_MapData + ".xml", true);
                    this.WinClose();
                    break;

                case "CCForm":
                    this.Application.Clear();
                    if (WebUser.NoOfRel != "admin")
                    {
                        BP.Port.Emp emp = new BP.Port.Emp("admin");
                        BP.Web.WebUser.SignInOfGener(emp);
                    }

                    MapAttr mattr = new MapAttr();
                    mattr.MyPK = this.Request.QueryString["MyPK"];
                    int i = mattr.RetrieveFromDBSources();
                    mattr.KeyOfEn    = this.Request.QueryString["KeyOfEn"];
                    mattr.FK_MapData = this.Request.QueryString["FK_MapData"];
                    mattr.MyDataType = int.Parse(this.Request.QueryString["DataType"]);

                    if (!string.IsNullOrEmpty(this.Request.QueryString["UIBindKey"] + ""))
                    {
                        mattr.UIBindKey = this.Request.QueryString["UIBindKey"];
                    }
                    mattr.UIContralType = (UIContralType)int.Parse(this.Request.QueryString["UIContralType"]);
                    mattr.LGType        = (BP.En.FieldTypeS) int.Parse(this.Request.QueryString["LGType"]);
                    if (i == 0)
                    {
                        mattr.Name       = System.Web.HttpUtility.UrlDecode(this.Request.QueryString["KeyName"], System.Text.Encoding.GetEncoding("GB2312"));
                        mattr.UIIsEnable = true;
                        mattr.UIVisible  = true;
                        if (mattr.LGType == FieldTypeS.Enum)
                        {
                            mattr.DefVal = "0";
                        }
                        mattr.Insert();
                    }
                    else
                    {
                        mattr.Update();
                    }

                    switch (mattr.LGType)
                    {
                    case BP.En.FieldTypeS.Enum:
                        this.Response.Redirect("EditEnum.aspx?MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK, true);
                        return;

                    case BP.En.FieldTypeS.Normal:
                        this.Response.Redirect("EditF.aspx?DoType=Edit&MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK + "&FType=" + mattr.MyDataType + "&GroupField=0", true);
                        return;

                    case BP.En.FieldTypeS.FK:
                        this.Response.Redirect("EditTable.aspx?DoType=Edit&MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK + "&FType=" + mattr.MyDataType + "&GroupField=0", true);
                        return;

                    default:
                        break;
                    }
                    break;

                case "DobackToF":
                    MapAttr ma = new MapAttr(this.RefNo);
                    switch (ma.LGType)
                    {
                    case FieldTypeS.Normal:
                        this.Response.Redirect("EditF.aspx?RefNo=" + this.RefNo, true);
                        return;

                    case FieldTypeS.FK:
                        this.Response.Redirect("EditTable.aspx?RefNo=" + this.RefNo, true);
                        return;

                    case FieldTypeS.Enum:
                        this.Response.Redirect("EditEnum.aspx?RefNo=" + this.RefNo, true);
                        return;

                    default:
                        return;
                    }
                    break;

                case "AddEnum":
                    SysEnumMain sem1    = new SysEnumMain(this.Request.QueryString["EnumKey"]);
                    MapAttr     attrAdd = new MapAttr();
                    attrAdd.KeyOfEn = sem1.No;
                    if (attrAdd.IsExit(MapAttrAttr.FK_MapData, this.MyPK, MapAttrAttr.KeyOfEn, sem1.No))
                    {
                        BP.Sys.PubClass.Alert("字段已经存在 [" + sem1.No + "]。");
                        BP.Sys.PubClass.WinClose();
                        return;
                    }

                    attrAdd.FK_MapData    = this.MyPK;
                    attrAdd.Name          = sem1.Name;
                    attrAdd.UIContralType = UIContralType.DDL;
                    attrAdd.UIBindKey     = sem1.No;
                    attrAdd.MyDataType    = BP.DA.DataType.AppInt;
                    attrAdd.LGType        = FieldTypeS.Enum;
                    attrAdd.DefVal        = "0";
                    attrAdd.UIIsEnable    = true;
                    if (this.Idx == null || this.Idx == "")
                    {
                        MapAttrs attrs1 = new MapAttrs(this.MyPK);
                        attrAdd.Idx = 0;
                    }
                    else
                    {
                        attrAdd.Idx = int.Parse(this.Idx);
                    }
                    attrAdd.Insert();
                    this.Response.Redirect("EditEnum.aspx?MyPK=" + this.MyPK + "&RefNo=" + attrAdd.MyPK, true);
                    this.WinClose();
                    return;

                case "DelEnum":
                    string      eKey = this.Request.QueryString["EnumKey"];
                    SysEnumMain sem  = new SysEnumMain();
                    sem.No = eKey;
                    sem.Delete();
                    this.WinClose();
                    return;

                case "AddSysEnum":
                    this.AddFEnum();
                    break;

                case "AddSFTable":
                    this.AddSFTable();
                    break;

                case "AddSFTableAttr":
                    SFTable sf = new SFTable(this.Request.QueryString["RefNo"]);
                    this.Response.Redirect("EditTable.aspx?MyPK=" + this.MyPK + "&SFKey=" + sf.No, true);
                    this.WinClose();
                    return;

                case "AddFG":     /*执行一个插入列组的命令.*/
                    switch (this.RefNo)
                    {
                    case "IsPass":
                        MapDtl dtl = new MapDtl(this.FK_MapData);
                        dtl.IsEnablePass = true;         /*更新是否启动审核分组字段.*/
                        MapAttr attr = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "Check_Note";
                        attr.Name          = "审核意见";
                        attr.MyDataType    = DataType.AppString;
                        attr.UIContralType = UIContralType.TB;
                        attr.DefVal        = "同意";
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = true;
                        attr.MaxLen        = 4000;
                        attr.ColSpan       = 4;   // 默认为4列。
                        attr.Idx           = 1;
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "Checker";
                        attr.Name          = "审核人";// "审核人";
                        attr.MyDataType    = DataType.AppString;
                        attr.UIContralType = UIContralType.TB;
                        attr.MaxLen        = 50;
                        attr.MinLen        = 0;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.DefVal        = "@WebUser.Name";
                        attr.UIIsEnable    = false;
                        attr.IsSigan       = true;
                        attr.Idx           = 2;
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "IsPass";
                        attr.Name          = "通过否?";// "审核人";
                        attr.MyDataType    = DataType.AppBoolean;
                        attr.UIContralType = UIContralType.CheckBok;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.UIIsEnable    = false;
                        attr.IsSigan       = true;
                        attr.DefVal        = "1";
                        attr.Idx           = 2;
                        attr.DefVal        = "0";
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "Check_RDT";
                        attr.Name          = "审核日期"; // "审核日期";
                        attr.MyDataType    = DataType.AppDateTime;
                        attr.UIContralType = UIContralType.TB;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.DefVal        = "@RDT";
                        attr.UIIsEnable    = false;
                        attr.Idx           = 3;
                        attr.Insert();

                        /* 处理批次ID*/
                        attr            = new MapAttr();
                        attr.FK_MapData = this.FK_MapData;
                        attr.KeyOfEn    = "BatchID";
                        attr.Name       = "BatchID";  // this.ToE("IsPass", "是否通过");// "审核人";
                        attr.MyDataType = DataType.AppInt;
                        attr.UIIsEnable = false;
                        attr.UIIsLine   = false;
                        attr.UIIsEnable = false;
                        attr.UIVisible  = false;
                        attr.Idx        = 2;
                        attr.DefVal     = "0";
                        attr.Insert();

                        dtl.Update();
                        this.WinClose();
                        return;

                    case "Eval":         /* 质量评价 */
                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "EvalEmpNo";
                        attr.Name          = "被评价人员编号";
                        attr.MyDataType    = DataType.AppString;
                        attr.UIContralType = UIContralType.TB;
                        attr.MaxLen        = 50;
                        attr.MinLen        = 0;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.UIIsEnable    = false;
                        attr.IsSigan       = true;
                        attr.Idx           = 1;
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "EvalEmpName";
                        attr.Name          = "被评价人员名称";
                        attr.MyDataType    = DataType.AppString;
                        attr.UIContralType = UIContralType.TB;
                        attr.MaxLen        = 50;
                        attr.MinLen        = 0;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.UIIsEnable    = false;
                        attr.IsSigan       = true;
                        attr.Idx           = 2;
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "EvalCent";
                        attr.Name          = "工作得分";
                        attr.MyDataType    = DataType.AppFloat;
                        attr.UIContralType = UIContralType.TB;
                        attr.MaxLen        = 50;
                        attr.MinLen        = 0;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.UIIsEnable    = true;
                        attr.Idx           = 3;
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "EvalNote";
                        attr.Name          = "评价信息";
                        attr.MyDataType    = DataType.AppString;
                        attr.UIContralType = UIContralType.TB;
                        attr.MaxLen        = 50;
                        attr.MinLen        = 0;
                        attr.UIIsEnable    = true;
                        attr.UIIsEnable    = true;
                        attr.Idx           = 4;
                        attr.Insert();
                        this.WinClose();
                        return;

                    default:
                        break;
                    }
                    break;

                case "AddFGroup":
                    this.AddFGroup();
                    return;

                case "AddF":
                case "ChoseFType":
                    this.AddF();
                    break;

                case "Up":
                    MapAttr attrU = new MapAttr(this.RefNo);
                    if (this.Request.QueryString["IsDtl"] != null)
                    {
                        attrU.DoDtlUp();
                    }
                    else
                    {
                        attrU.DoUp();
                    }

                    this.WinClose();
                    break;

                case "Down":     //让一个字段下移动.
                    MapAttr attrD = new MapAttr(this.RefNo);
                    attrD.DoDown();
                    this.WinClose();
                    break;

                case "DownAttr":     //让一个字段下移动.
                    MapAttr attrAttr = new MapAttr(this.RefNo);
                    attrAttr.DoDtlDown();
                    this.WinClose();
                    break;

                case "Jump":
                    MapAttr attrFrom = new MapAttr(this.Request.QueryString["FromID"]);
                    MapAttr attrTo   = new MapAttr(this.Request.QueryString["ToID"]);
                    attrFrom.DoJump(attrTo);
                    this.WinClose();
                    break;

                case "MoveTo":
                    string  toID     = this.Request.QueryString["ToID"];
                    int     toGFID   = int.Parse(this.Request.QueryString["ToGID"]);
                    int     fromGID  = int.Parse(this.Request.QueryString["FromGID"]);
                    string  fromID   = this.Request.QueryString["FromID"];
                    MapAttr fromAttr = new MapAttr();
                    fromAttr.MyPK = fromID;
                    fromAttr.Retrieve();
                    if (toGFID == fromAttr.GroupID && fromAttr.MyPK == toID)
                    {
                        /* 如果没有移动. */
                        this.WinClose();
                        return;
                    }
                    if (toGFID != fromAttr.GroupID && fromAttr.MyPK == toID)
                    {
                        MapAttr toAttr = new MapAttr(toID);
                        fromAttr.Update(MapAttrAttr.GroupID, toAttr.GroupID, MapAttrAttr.Idx, toAttr.Idx);
                        this.WinClose();
                        return;
                    }
                    this.Response.Redirect(this.Request.RawUrl.Replace("MoveTo", "Jump"), true);
                    return;

                case "Edit":
                    Edit();
                    break;

                case "Del":
                    MapAttr attrDel = new MapAttr();
                    attrDel.MyPK = this.RefNo;
                    attrDel.Delete();
                    this.WinClose();
                    break;

                case "GFDoUp":
                    GroupField gf = new GroupField(this.RefOID);
                    gf.DoUp();
                    gf.Retrieve();
                    if (gf.Idx == 0)
                    {
                        this.WinClose();
                        return;
                    }
                    int oidIdx = gf.Idx;
                    gf.Idx = gf.Idx - 1;
                    GroupField gfUp = new GroupField();
                    if (gfUp.Retrieve(GroupFieldAttr.EnName, gf.EnName, GroupFieldAttr.Idx, gf.Idx) == 1)
                    {
                        gfUp.Idx = oidIdx;
                        gfUp.Update();
                    }
                    gf.Update();
                    this.WinClose();
                    break;

                case "GFDoDown":
                    GroupField mygf = new GroupField(this.RefOID);
                    mygf.DoDown();
                    mygf.Retrieve();
                    int oidIdx1 = mygf.Idx;
                    mygf.Idx = mygf.Idx + 1;
                    GroupField gfDown = new GroupField();
                    if (gfDown.Retrieve(GroupFieldAttr.EnName, mygf.EnName, GroupFieldAttr.Idx, mygf.Idx) == 1)
                    {
                        gfDown.Idx = oidIdx1;
                        gfDown.Update();
                    }
                    mygf.Update();
                    this.WinClose();
                    break;

                case "AthDoUp":
                    FrmAttachment frmAth = new FrmAttachment(this.MyPK);
                    if (frmAth.RowIdx > 0)
                    {
                        frmAth.RowIdx = frmAth.RowIdx - 1;
                        frmAth.Update();
                    }
                    this.WinClose();
                    break;

                case "AthDoDown":
                    FrmAttachment frmAthD = new FrmAttachment(this.MyPK);
                    if (frmAthD.RowIdx < 10)
                    {
                        frmAthD.RowIdx = frmAthD.RowIdx + 1;
                        frmAthD.Update();
                    }
                    this.WinClose();
                    break;

                case "DtlDoUp":
                    MapDtl dtl1 = new MapDtl(this.MyPK);
                    if (dtl1.RowIdx > 0)
                    {
                        dtl1.RowIdx = dtl1.RowIdx - 1;
                        dtl1.Update();
                    }
                    this.WinClose();
                    break;

                case "DtlDoDown":
                    MapDtl dtl2 = new MapDtl(this.MyPK);
                    if (dtl2.RowIdx < 10)
                    {
                        dtl2.RowIdx = dtl2.RowIdx + 1;
                        dtl2.Update();
                    }
                    this.WinClose();
                    break;

                case "M2MDoUp":
                    MapM2M ddtl1 = new MapM2M(this.MyPK);
                    if (ddtl1.RowIdx > 0)
                    {
                        ddtl1.RowIdx = ddtl1.RowIdx - 1;
                        ddtl1.Update();
                    }
                    this.WinClose();
                    break;

                case "M2MDoDown":
                    MapM2M ddtl2 = new MapM2M(this.MyPK);
                    if (ddtl2.RowIdx < 10)
                    {
                        ddtl2.RowIdx = ddtl2.RowIdx + 1;
                        ddtl2.Update();
                    }
                    this.WinClose();
                    break;

                case "FrameDoUp":
                    MapFrame frame1 = new MapFrame(this.MyPK);
                    if (frame1.RowIdx > 0)
                    {
                        frame1.RowIdx = frame1.RowIdx - 1;
                        frame1.Update();
                    }
                    this.WinClose();
                    break;

                case "FrameDoDown":
                    MapFrame frame2 = new MapFrame(this.MyPK);
                    if (frame2.RowIdx < 10)
                    {
                        frame2.RowIdx = frame2.RowIdx + 1;
                        frame2.Update();
                    }
                    this.WinClose();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                this.Pub1.AddMsgOfWarning("错误:", ex.Message + " <br>" + this.Request.RawUrl);
            }
        }