Ejemplo n.º 1
0
        void btn_Click(object sender, EventArgs e)
        {
            BP.Sys.FrmField sln = new BP.Sys.FrmField();
            sln.Retrieve(BP.Sys.FrmFieldAttr.FK_MapData, this.FK_MapData,
                         BP.Sys.FrmFieldAttr.KeyOfEn, this.KeyOfEn,
                         BP.Sys.FrmFieldAttr.FK_Node, this.FK_Node);

            sln.UIIsEnable = this.Pub1.GetCBByID("CB_Readonly").Checked;
            sln.UIVisible  = this.Pub1.GetCBByID("CB_Visable").Checked;

            if (this.Pub1.IsExit("CB_IsSigan"))
            {
                sln.IsSigan = this.Pub1.GetCBByID("CB_IsSigan").Checked;
            }

            sln.DefVal = this.Pub1.GetTextBoxByID("TB_DefVal").Text;

            sln.FK_MapData = this.FK_MapData;
            sln.KeyOfEn    = this.KeyOfEn;
            sln.FK_Node    = int.Parse(this.FK_Node);
            sln.FK_Flow    = this.FK_Node;

            sln.MyPK = this.FK_MapData + "_" + this.FK_Flow + "_" + this.FK_Node + "_" + this.KeyOfEn;
            sln.CheckPhysicsTable();
            sln.Save();
            this.WinClose();
        }
Ejemplo n.º 2
0
        void btn_Field_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;

            if (btn.ID == "Btn_Del")
            {
                BP.Sys.FrmFields fss1 = new BP.Sys.FrmFields();
                fss1.Delete(BP.Sys.FrmFieldAttr.FK_MapData, this.FK_MapData,
                            BP.Sys.FrmFieldAttr.FK_Node, int.Parse(this.FK_Node));
                this.Response.Redirect("Sln.aspx?FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node + "&FK_MapData=" + this.FK_MapData + "&IsOk=1", true);
                return;
            }

            MapAttrs attrs = new MapAttrs(this.FK_MapData);
            // 查询出来解决方案.
            FrmFields fss = new  FrmFields();

            fss.Delete(FrmFieldAttr.FK_MapData, this.FK_MapData, FrmFieldAttr.FK_Node, int.Parse(this.FK_Node));

            foreach (MapAttr attr in attrs)
            {
                switch (attr.KeyOfEn)
                {
                case BP.WF.WorkAttr.RDT:
                case BP.WF.WorkAttr.FID:
                case BP.WF.WorkAttr.OID:
                case BP.WF.WorkAttr.Rec:
                case BP.WF.WorkAttr.MyNum:
                case BP.WF.WorkAttr.MD5:
                case BP.WF.WorkAttr.Emps:
                case BP.WF.WorkAttr.CDT:
                    continue;

                default:
                    break;
                }

                bool isChange  = false;
                bool UIVisible = this.Pub2.GetCBByID("CB_" + attr.KeyOfEn + "_UIVisible").Checked;
                if (attr.UIVisible != UIVisible)
                {
                    isChange = true;
                }

                bool UIIsEnable = this.Pub2.GetCBByID("CB_" + attr.KeyOfEn + "_UIIsEnable").Checked;
                if (attr.UIIsEnable != UIIsEnable)
                {
                    isChange = true;
                }

                bool IsSigan = this.Pub2.GetCBByID("CB_" + attr.KeyOfEn + "_IsSigan").Checked;
                if (attr.IsSigan != IsSigan)
                {
                    isChange = true;
                }

                string defVal = this.Pub2.GetTextBoxByID("TB_" + attr.KeyOfEn + "_DefVal").Text;
                if (attr.DefValReal != defVal)
                {
                    isChange = true;
                }

                bool IsNotNull = this.Pub2.GetCBByID("CB_" + attr.KeyOfEn + "_IsNotNull").Checked;
                if (IsNotNull == true)
                {
                    isChange = true;
                }

                bool IsWriteToFlowTable = this.Pub2.GetCBByID("CB_" + attr.KeyOfEn + "_" + FrmFieldAttr.IsWriteToFlowTable).Checked;
                if (IsWriteToFlowTable == true)
                {
                    isChange = true;
                }

                string exp = this.Pub2.GetTextBoxByID("TB_" + attr.KeyOfEn + "_RegularExp").Text;
                if (string.IsNullOrEmpty(exp))
                {
                    isChange = true;
                }

                if (isChange == false)
                {
                    continue;
                }

                BP.Sys.FrmField sln = new BP.Sys.FrmField();
                sln.UIVisible  = UIVisible;
                sln.UIIsEnable = UIIsEnable;
                sln.IsSigan    = IsSigan;
                sln.DefVal     = defVal;

                sln.IsNotNull          = IsNotNull;
                sln.RegularExp         = exp;
                sln.IsWriteToFlowTable = IsWriteToFlowTable;
                sln.FK_Node            = int.Parse(this.FK_Node);
                sln.FK_Flow            = this.FK_Flow;

                sln.FK_MapData = this.FK_MapData;
                sln.KeyOfEn    = attr.KeyOfEn;
                sln.Name       = attr.Name;

                sln.MyPK = this.FK_MapData + "_" + this.FK_Flow + "_" + this.FK_Node + "_" + attr.KeyOfEn;
                sln.Insert();
            }
            this.Response.Redirect("Sln.aspx?FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node + "&FK_MapData=" + this.FK_MapData + "&IsOk=1", true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 绑定方案
        /// </summary>
        public void BindSln()
        {
            // 查询出来解决方案.
            BP.Sys.FrmFields fss = new BP.Sys.FrmFields(this.FK_MapData, int.Parse(this.FK_Node));

            // 处理好.
            MapAttrs attrs = new MapAttrs(this.FK_MapData);

            this.Pub2.AddTable("80%");
            this.Pub2.AddTR();
            this.Pub2.AddTDTitle("Idx");
            this.Pub2.AddTDTitle("字段");
            this.Pub2.AddTDTitle("名称");
            this.Pub2.AddTDTitle("类型");

            this.Pub2.AddTDTitle("width='90px'", "可见?");
            this.Pub2.AddTDTitle("<input type='checkbox' id='s' onclick=\"CheckAll('UIIsEnable')\" />可用?");

            this.Pub2.AddTDTitle("是否是签名?");
            this.Pub2.AddTDTitle("默认值");

            this.Pub2.AddTDTitle("<input type='checkbox' id='s' onclick=\"CheckAll('IsNotNull')\" />检查必填?");
            this.Pub2.AddTDTitle("正则表达式");

            this.Pub2.AddTDTitle("<input type='checkbox' id='s' onclick=\"CheckAll('IsWriteToFlowTable')\" />写入流程数据表?");
            this.Pub2.AddTDTitle("");
            this.Pub2.AddTREnd();

            CheckBox cb = new CheckBox();
            TextBox  tb = new TextBox();

            int idx = 0;

            foreach (MapAttr attr in attrs)
            {
                switch (attr.KeyOfEn)
                {
                case BP.WF.WorkAttr.RDT:
                case BP.WF.WorkAttr.FID:
                case BP.WF.WorkAttr.OID:
                case BP.WF.WorkAttr.Rec:
                case BP.WF.WorkAttr.MyNum:
                case BP.WF.WorkAttr.MD5:
                case BP.WF.WorkAttr.Emps:
                case BP.WF.WorkAttr.CDT:
                    continue;

                default:
                    break;
                }

                idx++;
                this.Pub2.AddTR();
                this.Pub2.AddTDIdx(idx);
                this.Pub2.AddTD(attr.KeyOfEn);
                this.Pub2.AddTD(attr.Name);
                this.Pub2.AddTD(attr.LGTypeT);

                BP.Sys.FrmField sln = fss.GetEntityByKey(FrmFieldAttr.KeyOfEn, attr.KeyOfEn) as BP.Sys.FrmField;
                if (sln == null)
                {
                    cb         = new CheckBox();
                    cb.ID      = "CB_" + attr.KeyOfEn + "_UIVisible";
                    cb.Checked = attr.UIVisible;
                    cb.Text    = "可见?";
                    this.Pub2.AddTD("width=90px", cb);

                    cb         = new CheckBox();
                    cb.ID      = "CB_" + attr.KeyOfEn + "_UIIsEnable";
                    cb.Checked = attr.UIIsEnable;
                    cb.Text    = "可用?";
                    this.Pub2.AddTD("width=90px", cb);

                    cb         = new CheckBox();
                    cb.ID      = "CB_" + attr.KeyOfEn + "_IsSigan";
                    cb.Checked = attr.IsSigan;
                    cb.Text    = "是否数字签名?";
                    this.Pub2.AddTD("width=150px", cb);

                    tb      = new TextBox();
                    tb.ID   = "TB_" + attr.KeyOfEn + "_DefVal";
                    tb.Text = attr.DefValReal;
                    this.Pub2.AddTD(tb);


                    cb    = new CheckBox();
                    cb.ID = "CB_" + attr.KeyOfEn + "_" + FrmFieldAttr.IsNotNull;
                    // cb.Checked = attr.IsNotNull;
                    cb.Checked = false;
                    cb.Text    = "检查必填?";
                    this.Pub2.AddTD(cb);

                    tb    = new TextBox();
                    tb.ID = "TB_" + attr.KeyOfEn + "_" + FrmFieldAttr.RegularExp;
                    //tb.Text = attr.RegularExp;
                    //  tb.Columns = 150;
                    this.Pub2.AddTD(tb);


                    cb         = new CheckBox();
                    cb.ID      = "CB_" + attr.KeyOfEn + "_" + FrmFieldAttr.IsWriteToFlowTable;
                    cb.Checked = false;
                    cb.Text    = "是否写入流程表?";
                    this.Pub2.AddTD(cb);

                    this.Pub2.AddTD();
                    //this.Pub2.AddTD("<a href=\"javascript:EditSln('" + this.FK_MapData + "','" + this.SlnString + "','" + attr.KeyOfEn + "')\" >Edit</a>");
                }
                else
                {
                    cb         = new CheckBox();
                    cb.ID      = "CB_" + attr.KeyOfEn + "_UIVisible";
                    cb.Checked = sln.UIVisible;
                    cb.Text    = "可见?";
                    this.Pub2.AddTD("width=90px", cb);

                    cb         = new CheckBox();
                    cb.ID      = "CB_" + attr.KeyOfEn + "_UIIsEnable";
                    cb.Checked = sln.UIIsEnable;
                    cb.Text    = "可用?";
                    this.Pub2.AddTD("width=90px", cb);

                    cb         = new CheckBox();
                    cb.ID      = "CB_" + attr.KeyOfEn + "_IsSigan";
                    cb.Checked = sln.IsSigan;
                    cb.Text    = "是否数字签名?";
                    this.Pub2.AddTD("width=150px", cb);

                    tb      = new TextBox();
                    tb.ID   = "TB_" + attr.KeyOfEn + "_DefVal";
                    tb.Text = sln.DefVal;
                    this.Pub2.AddTD(tb);

                    cb         = new CheckBox();
                    cb.ID      = "CB_" + attr.KeyOfEn + "_" + FrmFieldAttr.IsNotNull;
                    cb.Checked = sln.IsNotNull;
                    cb.Text    = "必填?";
                    this.Pub2.AddTD(cb);

                    tb      = new TextBox();
                    tb.ID   = "TB_" + attr.KeyOfEn + "_RegularExp";
                    tb.Text = sln.RegularExp;
                    this.Pub2.AddTD(tb);

                    cb         = new CheckBox();
                    cb.ID      = "CB_" + attr.KeyOfEn + "_" + FrmFieldAttr.IsWriteToFlowTable;
                    cb.Checked = sln.IsWriteToFlowTable;
                    cb.Text    = "写入流程数据表?";
                    this.Pub2.AddTD(cb);

                    this.Pub2.AddTD("<a href=\"javascript:DelSln('" + this.FK_MapData + "','" + this.FK_Flow + "','" + this.FK_Node + "','" + this.FK_Node + "','" + attr.KeyOfEn + "')\" ><img src='../Img/Btn/Delete.gif' border=0/>Delete</a>");
                }
                this.Pub2.AddTREnd();
            }
            this.Pub2.AddTableEnd();

            Button btn = new Button();

            btn.ID     = "Btn_Save";
            btn.Click += new EventHandler(btn_Field_Click);
            btn.Text   = " Save ";
            this.Pub2.Add(btn); //保存.

            if (fss.Count != 0)
            {
                btn        = new Button();
                btn.ID     = "Btn_Del";
                btn.Click += new EventHandler(btn_Field_Click);
                btn.Text   = " Delete All ";
                btn.Attributes["onclick"] = "return confirm('Are you sure?');";
                this.Pub2.Add(btn); //删除定义..
            }

            if (dtNodes.Rows.Count >= 1)
            {
                btn        = new Button();
                btn.ID     = "Btn_Copy";
                btn.Click += new EventHandler(btn_Field_Click);
                btn.Text   = " Copy From Node ";
                btn.Attributes["onclick"] = "CopyIt('" + this.FK_MapData + "','" + this.FK_Flow + "','" + this.FK_Node + "')";
                this.Pub2.Add(btn); //删除定义..
            }
        }
Ejemplo n.º 4
0
        public void EditSln()
        {
            BP.Sys.FrmField sln = new BP.Sys.FrmField();
            int             num = sln.Retrieve(FrmFieldAttr.FK_MapData, this.FK_MapData,
                                               FrmFieldAttr.KeyOfEn, this.KeyOfEn,
                                               FrmFieldAttr.FK_Node, this.FK_Node);

            BP.Sys.MapAttr attr = new MapAttr();
            attr.Retrieve(MapAttrAttr.FK_MapData, this.FK_MapData,
                          MapAttrAttr.KeyOfEn, this.KeyOfEn);

            if (num == 0)
            {
                sln.UIIsEnable = attr.UIIsEnable;
                sln.UIVisible  = attr.UIVisible;
                sln.IsSigan    = attr.IsSigan;
                sln.DefVal     = attr.DefValReal;
            }

            this.Pub1.AddTable();
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("项目");
            this.Pub1.AddTDTitle("信息");
            this.Pub1.AddTDTitle("备注");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("字段");
            this.Pub1.AddTD(attr.KeyOfEn);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("中文名");
            this.Pub1.AddTD(attr.Name);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD();
            CheckBox cb = new CheckBox();

            cb.ID      = "CB_Visable";
            cb.Text    = "是否可见?";
            cb.Checked = sln.UIVisible;

            this.Pub1.AddTD(cb);
            this.Pub1.AddTD("在该方案中是否可见?");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD();
            cb         = new CheckBox();
            cb.ID      = "CB_Readonly";
            cb.Text    = "是否只读?";
            cb.Checked = sln.UIIsEnable;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD("在该方案中是否只读?");
            this.Pub1.AddTREnd();

            if (attr.MyDataType == DataType.AppString)
            {
                /*只读,并且是String. */
                this.Pub1.AddTR();
                this.Pub1.AddTD();
                cb         = new CheckBox();
                cb.ID      = "CB_IsSigan";
                cb.Text    = "是否是数字签名?";
                cb.Checked = sln.IsSigan;
                this.Pub1.AddTD(cb);
                this.Pub1.AddTD("如果是,并且需要在当前方案显示当前人员的签名:<br>请在默认值里输入@WebUser.No");
                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTR();
            this.Pub1.AddTD("默认值");
            TextBox tb = new TextBox();

            tb.ID   = "TB_DefVal";
            tb.Text = sln.DefVal;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("支持ccflow的全局变量.");
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();

            Button btn = new Button();

            btn.ID     = "Btn_Save";
            btn.Text   = "Save";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            this.Pub1.AddFieldSet("流程表单中的数字签名设置方法");
            this.Pub1.AddBR("应用概述:");
            this.Pub1.AddBR("1, 一个流程表单上会有多出数字签名. ");
            this.Pub1.AddBR("2, 这些数字签名有时会读取以前的签名,有时需要当前的数字签名。");
            this.Pub1.AddBR("3, 如果当前方案需要读取以前的数字签名,那就清除默认值信息,否则就设置@WebUser.No 获取当前操作员的数字签名。");
            this.Pub1.AddFieldSetEnd();
        }