Example #1
0
    void btn_SearchCond_Click(object sender, EventArgs e)
    {
        MapData  md     = new MapData(this.FK_MapData);
        MapAttrs mattrs = md.HisShowColsAttrs;
        string   keys   = "";

        foreach (MapAttr mattr in mattrs)
        {
            if (mattr.UIContralType != UIContralType.DDL)
            {
                continue;
            }
            CheckBox cb = this.Pub2.GetCBByID("CB_F_" + mattr.KeyOfEn);
            if (cb.Checked)
            {
                keys += "@" + mattr.KeyOfEn;
            }
        }

        md.SearchKeys  = keys;
        md.IsSearchKey = this.Pub2.GetCBByID("CB_IsSearchKey").Checked;

        if (this.Pub2.IsExit("DDL_DTSearchWay"))
        {
            BP.Web.Controls.DDL ddl = this.Pub2.GetDDLByID("DDL_DTSearchWay");
            md.HisDTSearchWay = (DTSearchWay)ddl.SelectedItemIntVal;

            ddl            = this.Pub2.GetDDLByID("DDL_DTSearchKey");
            md.DTSearchKey = ddl.SelectedItemStringVal;
        }
        md.Update();
        Cash.Map_Cash.Remove(this.FK_MapData);
        this.Alert("保存成功.");
    }
        public void AddFEnum()
        {
            this.Title = "增加新字段向导";
            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "'>增加新字段向导</a> - <a href='SysEnum.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "' ><img src='../Img/Btn/New.gif' />新建枚举</a>");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("编号(点击增加到表单)");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("操作");
            this.Pub1.AddTDTitle();
            this.Pub1.AddTREnd();

            BP.Sys.SysEnumMains sems = new SysEnumMains();
            QueryObject         qo   = new QueryObject(sems);

            this.Pub2.BindPageIdx(qo.GetCount(), pageSize, this.PageIdx, "Do.aspx?DoType=AddSysEnum&MyPK=" + this.MyPK + "&Idx=&GroupField");
            qo.DoQuery("No", pageSize, this.PageIdx);

            bool is1 = false;
            int  Idx = 0;

            foreach (BP.Sys.SysEnumMain sem in sems)
            {
                BP.Web.Controls.DDL ddl = null;
                try
                {
                    ddl = new BP.Web.Controls.DDL();
                    ddl.BindSysEnum(sem.No);
                }
                catch
                {
                    sem.Delete();
                }
                Idx++;
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTDIdx(Idx);
                this.Pub1.AddTD("<a  href=\"javascript:AddEnum('" + this.MyPK + "','" + this.Idx + "','" + sem.No + "')\" >" + sem.No + "</a>");
                this.Pub1.AddTD(sem.Name);
                this.Pub1.AddTD("[<a href='SysEnum.aspx?DoType=Edit&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "&RefNo=" + sem.No + "' >编辑</a>]");
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
        /// <summary>
        /// 执行数据的保存操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btn_Click(object sender, EventArgs e)
        {
            string   rpt   = "ND" + int.Parse(this.FK_Flow) + "Rpt";
            MapAttrs attrs = new MapAttrs(rpt);
            //string vals = "";

            string lcDTSFields = "";
            string ywDTSFields = "";

            foreach (MapAttr attr in attrs)
            {
                CheckBox cb = this.Pub1.GetCBByID("CB_" + attr.KeyOfEn);
                if (cb == null || cb.Checked == false)
                {
                    continue;
                }

                BP.Web.Controls.DDL ddl = this.Pub1.GetDDLByID("DDL_" + attr.KeyOfEn);
                //vals += "@" + attr.KeyOfEn + "=" + ddl.SelectedItemStringVal;
                lcDTSFields += attr.KeyOfEn + ",";
                ywDTSFields += ddl.SelectedItemStringVal + ",";
            }

            lcDTSFields = lcDTSFields.Substring(0, lcDTSFields.Length - 1);
            ywDTSFields = ywDTSFields.Substring(0, ywDTSFields.Length - 1);

            if (string.IsNullOrEmpty(lcDTSFields) == true || string.IsNullOrEmpty(ywDTSFields) == true)
            {
                BP.Sys.PubClass.Alert("要配置的内容为空...");
                return;
            }

            //保存数据.
            Flow fl = new Flow(this.FK_Flow);

            fl.DTSFields = lcDTSFields + "@" + ywDTSFields;
            fl.Update();

            BP.Sys.PubClass.WinClose();
        }
Example #4
0
        void btn_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;

            try
            {
                BP.Web.Controls.DDL DDL_ImpWay            = (BP.Web.Controls.DDL) this.Pub1.FindControl("DDL_ImpWay");
                System.Web.UI.WebControls.FileUpload fuit = (System.Web.UI.WebControls.FileUpload) this.Pub1.FindControl("fup");
                if (DDL_ImpWay.SelectedIndex == 0)
                {
                    this.Alert("请选择导入方式.");
                    return;
                }

                string tempPath = this.Request.PhysicalApplicationPath + "\\Temp\\";
                if (System.IO.Directory.Exists(tempPath) == false)
                {
                    System.IO.Directory.CreateDirectory(tempPath);
                }

                MapDtl dtl = new MapDtl(this.FK_MapDtl);

                //求出扩展名.
                string fileName = fuit.FileName.ToLower();
                if (fileName.Contains(".xls") == false)
                {
                    this.Alert("上传的文件必须是excel文件.");
                    return;
                }
                string ext = ".xls";
                if (fileName.Contains(".xlsx"))
                {
                    ext = ".xlsx";
                }

                //保存临时文件.
                string file = tempPath + WebUser.No + ext;
                fuit.SaveAs(file);

                GEDtls dtls = new GEDtls(this.FK_MapDtl);
                System.Data.DataTable dt = BP.DA.DBLoad.GetTableByExt(file);

                file = this.Request.PhysicalApplicationPath + "\\DataUser\\DtlTemplete\\" + this.FK_MapDtl + ext;
                if (System.IO.File.Exists(file) == false)
                {
                    if (ext == ".xlsx")
                    {
                        file = this.Request.PhysicalApplicationPath + "\\DataUser\\DtlTemplete\\" + this.FK_MapDtl + ".xls";
                    }
                    else
                    {
                        file = this.Request.PhysicalApplicationPath + "\\DataUser\\DtlTemplete\\" + this.FK_MapDtl + ".xls";
                    }
                }

                System.Data.DataTable dtTemplete = BP.DA.DBLoad.GetTableByExt(file);

                #region 检查两个文件是否一致。
                foreach (DataColumn dc in dtTemplete.Columns)
                {
                    bool isHave = false;
                    foreach (DataColumn mydc in dt.Columns)
                    {
                        if (dc.ColumnName == mydc.ColumnName)
                        {
                            isHave = true;
                            break;
                        }
                    }
                    if (isHave == false)
                    {
                        throw new Exception("@您导入的excel文件不符合系统要求的格式,请下载模版文件重新填入。");
                    }
                }
                #endregion 检查两个文件是否一致。

                #region 生成要导入的属性.

                BP.En.Attrs attrs    = dtls.GetNewEntity.EnMap.Attrs;
                BP.En.Attrs attrsExp = new BP.En.Attrs();
                foreach (DataColumn dc in dtTemplete.Columns)
                {
                    foreach (Attr attr in attrs)
                    {
                        if (attr.UIVisible == false)
                        {
                            continue;
                        }

                        if (attr.IsRefAttr)
                        {
                            continue;
                        }

                        if (attr.Desc == dc.ColumnName.Trim())
                        {
                            attrsExp.Add(attr);
                            break;
                        }
                    }
                }
                #endregion 生成要导入的属性.

                #region 执行导入数据.
                if (DDL_ImpWay.SelectedIndex == 1)
                {
                    BP.DA.DBAccess.RunSQL("DELETE FROM " + dtl.PTable + " WHERE RefPK='" + this.WorkID + "'");
                }

                int    i   = 0;
                Int64  oid = BP.DA.DBAccess.GenerOID("Dtl", dt.Rows.Count);
                string rdt = BP.DA.DataType.CurrentData;

                string errMsg = "";
                foreach (DataRow dr in dt.Rows)
                {
                    GEDtl dtlEn = dtls.GetNewEntity as GEDtl;
                    dtlEn.ResetDefaultVal();

                    foreach (BP.En.Attr attr in attrsExp)
                    {
                        if (attr.UIVisible == false || dr[attr.Desc] == DBNull.Value)
                        {
                            continue;
                        }
                        string val = dr[attr.Desc].ToString();
                        if (val == null)
                        {
                            continue;
                        }
                        val = val.Trim();
                        switch (attr.MyFieldType)
                        {
                        case FieldType.Enum:
                        case FieldType.PKEnum:
                            SysEnums ses     = new SysEnums(attr.UIBindKey);
                            bool     isHavel = false;
                            foreach (SysEnum se in ses)
                            {
                                if (val == se.Lab)
                                {
                                    val     = se.IntKey.ToString();
                                    isHavel = true;
                                    break;
                                }
                            }
                            if (isHavel == false)
                            {
                                errMsg += "@数据格式不规范,第(" + i + ")行,列(" + attr.Desc + "),数据(" + val + ")不符合格式,改值没有在枚举列表里.";
                                val     = attr.DefaultVal.ToString();
                            }
                            break;

                        case FieldType.FK:
                        case FieldType.PKFK:
                            Entities ens = null;
                            if (attr.UIBindKey.Contains("."))
                            {
                                ens = BP.En.ClassFactory.GetEns(attr.UIBindKey);
                            }
                            else
                            {
                                ens = new GENoNames(attr.UIBindKey, "desc");
                            }

                            ens.RetrieveAll();
                            bool isHavelIt = false;
                            foreach (Entity en in ens)
                            {
                                if (val == en.GetValStrByKey("Name"))
                                {
                                    val       = en.GetValStrByKey("No");
                                    isHavelIt = true;
                                    break;
                                }
                            }
                            if (isHavelIt == false)
                            {
                                errMsg += "@数据格式不规范,第(" + i + ")行,列(" + attr.Desc + "),数据(" + val + ")不符合格式,改值没有在外键数据列表里.";
                            }
                            break;

                        default:
                            break;
                        }

                        if (attr.MyDataType == BP.DA.DataType.AppBoolean)
                        {
                            if (val.Trim() == "是" || val.Trim().ToLower() == "yes")
                            {
                                val = "1";
                            }

                            if (val.Trim() == "否" || val.Trim().ToLower() == "no")
                            {
                                val = "0";
                            }
                        }

                        dtlEn.SetValByKey(attr.Key, val);
                    }
                    dtlEn.RefPKInt = (int)this.WorkID;
                    dtlEn.SetValByKey("RDT", rdt);
                    dtlEn.SetValByKey("Rec", WebUser.No);
                    i++;

                    dtlEn.InsertAsOID(oid);
                    oid++;
                }
                #endregion 执行导入数据.

                if (string.IsNullOrEmpty(errMsg) == true)
                {
                    this.Alert("共有(" + i + ")条数据导入成功。");
                }
                else
                {
                    this.Alert("共有(" + i + ")条数据导入成功,但是出现如下错误:" + errMsg);
                }
            }
            catch (Exception ex)
            {
                string msg = ex.Message.Replace("'", "‘");
                this.Alert(msg);
            }
        }
Example #5
0
    public void BindAdv()
    {
        EnsAppCfgs ens = new EnsAppCfgs();

        ens.Retrieve(EnsAppCfgAttr.EnsName, this.EnsName);

        if (ens.Count == 0)
        {
            this.UCSys1.AddMsgOfInfo("提示:", "没有设置应用程序配置。");
            return;
        }

        this.UCSys1.AddTable("width=100%");
        if (BP.Web.WebUser.No == "admin")
        {
            this.UCSys1.AddCaptionLeftTX("<a href='?EnsName=" + this.EnsName + "'>基本设置</a> - <a href='?EnsName=" + this.EnsName + "&DoType=Adv'>高级设置</a> - <a href='EnsDataIO.aspx?EnsName=" + this.EnsName + "' >导入导出</a>");
        }
        else
        {
            this.UCSys1.AddCaptionLeftTX("基本设置");
        }

        this.UCSys1.AddTR();
        this.UCSys1.AddTDTitle("配置项");
        this.UCSys1.AddTDTitle("内容");
        this.UCSys1.AddTDTitle("信息");
        this.UCSys1.AddTREnd();

        Entity en1   = BP.DA.ClassFactory.GetEns(this.EnsName).GetNewEntity;
        Attrs  attrs = en1.EnMap.HisCfgAttrs;
        bool   is1   = false;

        foreach (Attr attr in attrs)
        {
            if (attr.IsRefAttr)
            {
                continue;
            }
            EnsAppCfg en = ens.GetEntityByKey(EnsAppCfgAttr.CfgKey, attr.Key) as EnsAppCfg;
            is1 = this.UCSys1.AddTR(is1);
            this.UCSys1.AddTD(attr.Key);
            this.UCSys1.AddTD(attr.Desc);
            switch (attr.UIContralType)
            {
            case UIContralType.DDL:
                BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_" + attr.Key;

                SysEnums ses = new SysEnums(attr.Key, attr.UITag);
                ddl.BindSysEnum(attr.Key);
                if (en == null)
                {
                    ddl.SetSelectItem(attr.DefaultVal.ToString());
                }
                else
                {
                    ddl.SetSelectItem(en.CfgValOfInt);
                }

                this.UCSys1.AddTD(ddl);
                break;

            case UIContralType.CheckBok:
                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + attr.Key;
                cb.Text = attr.Desc;
                if (en == null)
                {
                    if (attr.DefaultVal.ToString() == "0")
                    {
                        cb.Checked = false;
                    }
                    else
                    {
                        cb.Checked = true;
                    }
                }
                else
                {
                    cb.Checked = en.CfgValOfBoolen;
                }
                this.UCSys1.AddTD(cb);
                break;

            default:
                TextBox tb = new TextBox();
                tb.ID = "TB_" + attr.Key;
                if (en == null)
                {
                    tb.Text = attr.DefaultVal.ToString();
                }
                else
                {
                    tb.Text = en.CfgVal;
                }
                tb.Attributes["width"] = "100%";
                this.UCSys1.AddTD(tb);
                break;
            }
            this.UCSys1.AddTREnd();
        }

        this.UCSys1.AddTableEnd();
        Button btn = new Button();

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

        btn          = new Button();
        btn.ID       = "Btn_SaveAndClose";
        btn.CssClass = "Btn";

        btn.Text   = "保存并关闭";
        btn.Click += new EventHandler(btn_Click);
        this.UCSys1.Add(btn);
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "字段复制";

            BP.WF.Node  nd  = new BP.WF.Node(this.FK_Node);
            BP.WF.Nodes nds = new BP.WF.Nodes(nd.FK_Flow);

            Node sNd = new Node(this.NodeOfSelect);

            MapAttrs attrs     = new MapAttrs(this.NodeOfSelect);
            MapAttrs attrsCopy = new MapAttrs(this.FK_Node);


            this.Pub1.AddFieldSet("选择节点");
            this.Pub1.AddUL("Main");
            foreach (BP.WF.Node en in nds)
            {
                if (this.NodeOfSelect == en.NodeID.ToString())
                {
                    this.Pub1.AddLiB("CopyFieldFromNode.aspx?FK_Node=" + this.FK_Node + "&NodeOfSelect=ND" + en.NodeID, "步骤:" + en.Step + ",名称:" + en.Name);
                }
                else
                {
                    this.Pub1.AddLi("CopyFieldFromNode.aspx?FK_Node=" + this.FK_Node + "&NodeOfSelect=ND" + en.NodeID, "步骤:" + en.Step + ",名称:" + en.Name);
                }
            }
            this.Pub1.AddULEnd();
            this.Pub1.AddFieldSetEnd();

            this.Pub2.AddTable("width='500px'");

            //this.Pub2.AddTR();
            //this.Pub2.AddTDTitle(this.ToE("Field", "字段"));
            ////this.Pub2.AddTDTitle("描述");
            ////this.Pub2.AddTDTitle("类型");
            ////this.Pub2.AddTDTitle(this.ToE("Show", "显示"));
            //this.Pub2.AddTREnd();

            GroupFields gfs  = new GroupFields(this.NodeOfSelect);
            MapDtls     dtls = new MapDtls(this.NodeOfSelect);
            MapM2Ms     m2ms = new MapM2Ms(this.NodeOfSelect);
            MapFrames   frms = new MapFrames(this.NodeOfSelect);

            bool isHave = false;

            foreach (GroupField gf in gfs)
            {
                this.Pub2.AddTRSum();
                CheckBox cb = new CheckBox();
                cb.ID   = "CB" + gf.OID;
                cb.Text = "<b>" + gf.Lab + "</b>";
                this.Pub2.AddTD(cb);
                this.Pub2.AddTREnd();

                foreach (MapDtl dtl in dtls)
                {
                    if (dtl.GroupID != gf.OID)
                    {
                        continue;
                    }

                    this.Pub2.AddTR();
                    cb      = new CheckBox();
                    cb.ID   = "CB" + dtl.No + "_" + dtl.GroupID;
                    cb.Text = "从表:" + dtl.Name;
                    this.Pub2.AddTD(cb);
                    this.Pub2.AddTREnd();
                }

                foreach (MapM2M m2m in m2ms)
                {
                    if (m2m.GroupID != gf.OID)
                    {
                        continue;
                    }
                    this.Pub2.AddTR();
                    cb      = new CheckBox();
                    cb.ID   = "CB" + m2m.MyPK + "_" + m2m.GroupID;
                    cb.Text = "多选" + ":" + m2m.Name;
                    this.Pub2.AddTD(cb);
                    this.Pub2.AddTREnd();
                }

                foreach (MapFrame frm in frms)
                {
                    if (frm.GroupID != gf.OID)
                    {
                        continue;
                    }
                    this.Pub2.AddTR();
                    cb      = new CheckBox();
                    cb.ID   = "CB" + frm.MyPK + "_" + frm.GroupID;
                    cb.Text = "框架" + ":" + frm.Name;
                    this.Pub2.AddTD(cb);
                    this.Pub2.AddTREnd();
                }


                this.Pub2.AddTR();
                this.Pub2.AddTDBigDocBegain();
                foreach (MapAttr attr in attrs)
                {
                    if (gf.OID != attr.GroupID)
                    {
                        continue;
                    }

                    switch (attr.KeyOfEn)
                    {
                    case BP.WF.GEStartWorkAttr.CDT:
                    case BP.WF.GEStartWorkAttr.Emps:
                    case BP.WF.GEStartWorkAttr.FID:
                    case BP.WF.GEStartWorkAttr.OID:
                    case BP.WF.GEStartWorkAttr.RDT:
                    case BP.WF.GEStartWorkAttr.Rec:
                    case BP.WF.GEStartWorkAttr.FK_NY:
                    case BP.WF.GEStartWorkAttr.WFState:
                    case BP.WF.GEStartWorkAttr.MyNum:
                    case BP.WF.GEStartWorkAttr.FK_Dept:
                    case BP.WF.GEStartWorkAttr.FK_DeptText:
                        continue;

                    default:
                        break;
                    }

                    cb      = new CheckBox();
                    cb.ID   = attr.KeyOfEn;
                    cb.Text = attr.KeyOfEn + " " + attr.Name;

                    if (attrsCopy.Contains(MapAttrAttr.KeyOfEn, attr.KeyOfEn))
                    {
                        cb.Enabled = false;
                    }
                    else
                    {
                        cb.Enabled = true;
                    }

                    isHave = true;
                    this.Pub2.Add(cb);
                }
                this.Pub2.AddTDEnd();
                this.Pub2.AddTREnd();
            }

            this.Pub2.AddTableEndWithBR();
            Button btn = new Button();

            btn.CssClass = "Btn";
            if (isHave == false)
            {
                return;
            }
            this.Pub2.Add("到分组:");
            gfs = new GroupFields(this.FK_Node);
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_GroupField";
            ddl.Bind(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab);
            ddl.SetSelectItem(this.GroupField);
            this.Pub2.Add(ddl);
            btn.ID   = "Btn_OK";
            btn.Text = " 复制 ";

            btn.UseSubmitBehavior = false;
            btn.OnClientClick     = "this.disabled=true;";
            //this.disabled='disabled'; return true;";
            // btn.Attributes["onclick"] = " return confirm('您确定要复制选择的字段到 [" + nd.Name + "]表单中吗?');";
            // btn.Attributes["onclick"] = " return confirm('" + this.ToE("AYS", "您确定要复制选择的字段到 [" + nd.Name + "]表单中吗?") + "');";

            btn.Click += new EventHandler(btn_Copy_Click);
            this.Pub2.Add(btn);
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string   rpt   = "ND" + int.Parse(this.FK_Flow) + "Rpt";
            MapAttrs attrs = new MapAttrs(rpt);

            Flow fl = new Flow(this.FK_Flow);

            fl.RetrieveFromDBSources();

            fl.No = this.FK_Flow;
            if (string.IsNullOrEmpty(this.TableName) == true)
            {
                this.Pub1.AddFieldSet("配置错误", "请关闭该窗口,在流程属性里配置业务表名,然后点保存按钮,之后打开该功能界面。");
                return;
            }

            //获得数据表列.
            SFDBSrc   src = new SFDBSrc(this.FK_DBSrc);
            DataTable dt  = src.GetColumns(this.TableName);

            foreach (DataRow dr in dt.Rows)
            {
                string fType = dr["DBType"].ToString();
                string desc  = dr["Name"].ToString();

                dr["Name"] = dr["No"] + " " + dr["DBType"] + "(" + dr["DBLength"] + ") " + dr["Name"];
            }

            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("请设置流程字段与业务表字段的同步映射");
            this.Pub1.AddTR();

            string textCenter = " style='text-align:center;'";

            this.Pub1.AddTDTitle(textCenter, "序");
            this.Pub1.AddTDTitle(textCenter, "是否同步");
            this.Pub1.AddTDTitle(textCenter, "类型");
            this.Pub1.AddTDTitle(textCenter, "业务表(" + fl.DTSBTable + ")");
            this.Pub1.AddTREnd();

            int       idx = 0;
            Hashtable ht  = new Hashtable();

            if (string.IsNullOrEmpty(fl.DTSFields))
            {
                fl.DTSFields = "@";
            }

            string[] fieldArr = fl.DTSFields.Split('@');
            string[] lcArr    = fieldArr[0].Split(',');
            string[] ywArr    = fieldArr[1].Split(',');

            for (int i = 0; i < lcArr.Length; i++)
            {
                ht.Add(lcArr[i], ywArr[i]);
            }


            #region 锁定workid 在第一行上.

            //guid workid必须选择一项
            BP.Web.Controls.RadioBtn rb_workId = new BP.Web.Controls.RadioBtn();
            rb_workId.ID        = "rb_workId";
            rb_workId.GroupName = "RB_KEY";
            rb_workId.Text      = "OID - WorkID";

            BP.Web.Controls.RadioBtn rb_guid = new BP.Web.Controls.RadioBtn();
            rb_guid.ID        = "rb_guid";
            rb_guid.GroupName = "RB_KEY";
            rb_guid.Text      = "GUID";

            foreach (DictionaryEntry de in ht)
            {
                if (de.Key.ToString().ToUpper() == "OID")
                {
                    rb_workId.Checked = true;
                }
                else
                {
                    rb_guid.Checked = true;
                }
            }

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx("1");

            this.Pub1.AddTDBegin();
            this.Pub1.Add(rb_workId);
            this.Pub1.Add(rb_guid);
            this.Pub1.AddTDEnd();

            this.Pub1.AddTD("主键<img src='../../Img/PRI/2.png' border=0/>");

            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.Width = 250;
            ddl.ID    = "DDL_OID";

            ddl.Bind(dt, dt.Columns["No"].ToString(), dt.Columns["Name"].ToString());
            ddl.SetSelectItem(fl.DTSBTablePK);

            this.Pub1.AddTD(textCenter, ddl);
            this.Pub1.AddTREnd();
            #endregion 锁定workid 在第一行上.


            bool is1 = false;
            foreach (MapAttr attr in attrs)
            {
                if (attr.KeyOfEn.ToUpper() == "OID" || attr.KeyOfEn.ToUpper() == "GUID")
                {
                    continue;
                }

                idx++;

                is1 = this.Pub1.AddTR(is1);

                this.Pub1.AddTDIdx(idx);

                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + attr.KeyOfEn;
                cb.Text = attr.KeyOfEn + " - " + attr.Name;

                foreach (DictionaryEntry de in ht)
                {
                    if (attr.KeyOfEn == de.Key.ToString())
                    {
                        cb.Checked = true;
                    }
                }

                this.Pub1.AddTD(cb);
                this.Pub1.AddTD(attr.MyDataTypeStr);

                ddl       = new BP.Web.Controls.DDL();
                ddl.ID    = "DDL_" + attr.KeyOfEn;
                ddl.Width = 250;

                ddl.Bind(dt, dt.Columns["No"].ToString(), dt.Columns["Name"].ToString());

                if (cb.Checked == true)
                {
                    try
                    {
                        ddl.SetSelectItem(ht[attr.KeyOfEn].ToString());
                    }
                    catch
                    {
                    }
                }

                //类似的默认选中  区分大小写  方法if(ddl.SetSelectItem(attr.KeyOfEn)){cb.Checked = true;}不适用
                foreach (DataRow dr in dt.Rows)
                {
                    if (attr.KeyOfEn.ToUpper() == dr[0].ToString().ToUpper())
                    {
                        ddl.SetSelectItem(dr[0].ToString());
                        cb.Checked = true;
                        break;
                    }
                }

                this.Pub1.AddTD(textCenter, ddl);
                this.Pub1.AddTREnd();
            }


            this.Pub1.AddTableEnd();

            this.Pub1.AddBR();
            this.Pub1.AddBR();

            Button btn = new Button();
            btn.ID   = "Btn_Save";
            btn.Text = "保存";

            btn.Click += new EventHandler(btn_Save_Click);

            Button btnClose = new Button();
            btnClose.ID     = "Btn_Close";
            btnClose.Text   = "取消";
            btnClose.Click += new EventHandler(btnClose_Click);

            this.Pub1.Add(btn);
            this.Pub1.Add(btnClose);

            this.Pub1.AddBR();
            this.Pub1.AddBR();
            this.Pub1.AddBR();
        }
Example #8
0
    public void BindNormal()
    {
        EnsAppCfgs ens = new EnsAppCfgs();

        ens.Retrieve(EnsAppCfgAttr.EnsName, this.EnsName);

        EnsAppXmls xmls = new EnsAppXmls();

        xmls.Retrieve(EnsAppCfgAttr.EnsName, this.EnsName);

        this.UCSys1.AddTable("width=100%");
        if (BP.Web.WebUser.No == "admin")
        {
            this.UCSys1.AddCaptionLeftTX("<a href='?EnsName=" + this.EnsName + "'>基本设置</a> - <a href='?EnsName=" + this.EnsName + "&DoType=Adv'>高级设置</a> - <a href='EnsDataIO.aspx?EnsName=" + this.EnsName + "' >导入导出</a>");
        }
        else
        {
            this.UCSys1.AddCaptionLeftTX("基本设置");
        }
        this.UCSys1.AddTR();

        this.UCSys1.AddTR();
        this.UCSys1.AddTDTitle("配置项");
        this.UCSys1.AddTDTitle("内容");
        this.UCSys1.AddTDTitle("信息");
        this.UCSys1.AddTDTitle("备注");

        //this.UCSys1.AddTDTitle("配置项");
        //this.UCSys1.AddTDTitle("内容");
        //this.UCSys1.AddTDTitle("信息");
        //this.UCSys1.AddTDTitle("备注");
        this.UCSys1.AddTREnd();

        bool is1 = false;

        foreach (EnsAppXml xml in xmls)
        {
            EnsAppCfg en = ens.GetEntityByKey(EnsAppCfgAttr.CfgKey, xml.No) as EnsAppCfg;
            is1 = this.UCSys1.AddTR(is1);
            this.UCSys1.AddTD(xml.No);
            this.UCSys1.AddTD(xml.Name);
            switch (xml.DBType)
            {
            case "Enum":
                BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_" + xml.No;

                SysEnums ses = new SysEnums(xml.EnumKey, xml.EnumVals);
                ddl.BindSysEnum(xml.EnumKey);

                if (en == null)
                {
                    ddl.SetSelectItem(xml.DefValInt);
                }
                else
                {
                    ddl.SetSelectItem(en.CfgValOfInt);
                }
                this.UCSys1.AddTD(ddl);
                break;

            case "Boolen":
                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + xml.No;
                cb.Text = xml.Name;
                if (en == null)
                {
                    cb.Checked = xml.DefValBoolen;
                }
                else
                {
                    cb.Checked = en.CfgValOfBoolen;
                }
                this.UCSys1.AddTD(cb);
                break;

            default:
                TextBox tb = new TextBox();
                tb.ID = "TB_" + xml.No;
                if (en == null)
                {
                    tb.Text = xml.DefVal;
                }
                else
                {
                    tb.Text = en.CfgVal;
                }
                tb.Attributes["width"] = "100%";
                this.UCSys1.AddTD(tb);
                break;
            }
            this.UCSys1.AddTDBigDoc(xml.Desc);
            this.UCSys1.AddTREnd();
        }

        if (xmls.Count == 0)
        {
            this.UCSys1.AddTableEnd();
            return;
        }


        this.UCSys1.AddTableEnd();
        Button btn = new Button();

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

        btn          = new Button();
        btn.ID       = "Btn_SaveAndClose";
        btn.CssClass = "Btn";
        btn.Text     = "保存并关闭";
        btn.Click   += new EventHandler(btn_Click);
        this.UCSys1.Add(btn);
    }
Example #9
0
        public void BindStep1()
        {
            this.Pub1.AddTable();
            this.Pub1.AddCaption("表单创建向导:填写表单基础信息");

            SysEnum se = new SysEnum(MapDataAttr.FrmType, this.FrmType);

            this.Pub1.AddTR();
            this.Pub1.AddTD("表单类型");
            this.Pub1.AddTD(se.Lab);
            this.Pub1.AddTD("返回上一步可以更改");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("数据源");
            BP.Sys.SFDBSrc srcs = new SFDBSrc(this.DBSrc);
            this.Pub1.AddTD(srcs.Name);
            this.Pub1.AddTD("您可以把表单创建不同的数据源上.");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTD("创建路径");
            //更改绑定样式 qin
            //BP.Sys.SysFormTrees trees = new SysFormTrees();

            //去除对应数据源根目录
            //trees.Retrieve(SysFormTreeAttr.DBSrc, this.DBSrc, SysFormTreeAttr.IsDir, "0");
            DataTable dt = DBAccess.RunSQLReturnTable("SELECT No,Name,ParentNo FROM Sys_FormTree WHERE DBSrc='local' AND IsDir='0'");

            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_FrmTree";
            BP.Web.Controls.DDL.MakeTree(dt, "ParentNo", "0", "No", "Name", ddl, -1);
            //ddl.Bind(trees, this.DBSrc);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("表单类别.");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTD("<font color='Red'>*</font>表单名称");
            TextBox tb = new TextBox();

            tb.ID           = "TB_Name";
            tb.Columns      = 90;
            tb.AutoPostBack = true;
            tb.TextChanged += new EventHandler(tb_TextChanged);
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("1到30个字符");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("<font color='Red'>*</font>表单编号");
            tb         = new TextBox();
            tb.ID      = "TB_No";
            tb.Columns = 90;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("以字母或者下划线开头,不能包含中文或者其他特殊字符.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("<font color='Red'>*</font>数据表");
            tb         = new TextBox();
            tb.ID      = "TB_PTable";
            tb.Columns = 90;

            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("只能以字母或者下划线开头,不能包含中文与其它特殊字符。");
            this.Pub1.AddTREnd();

            #region 快速填写.
            this.Pub1.AddTR();
            this.Pub1.AddTD("快速填写");
            this.Pub1.AddTDBegin();
            RadioButton rb = new RadioButton();
            rb.ID              = "RB0";
            rb.Text            = "生成全拼名称";
            rb.CheckedChanged += new EventHandler(tb_TextChanged);
            rb.Checked         = true;
            rb.AutoPostBack    = true;
            rb.GroupName       = "ss";
            this.Pub1.Add(rb);

            rb                 = new RadioButton();
            rb.ID              = "RB1";
            rb.Text            = "生成简拼名称";
            rb.CheckedChanged += new EventHandler(tb_TextChanged);
            rb.GroupName       = "ss";
            rb.AutoPostBack    = true;
            this.Pub1.Add(rb);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTD("注意:允许多个表单指定同一个表.");
            this.Pub1.AddTREnd();
            #endregion 快速填写.

            #region 表单生成方式.
            this.Pub1.AddTR();
            if ((BP.Sys.FrmType)(this.FrmType) != BP.Sys.FrmType.Url)
            {
                if ((BP.Sys.FrmType)(this.FrmType) == BP.Sys.FrmType.FreeFrm ||
                    (BP.Sys.FrmType)(this.FrmType) == BP.Sys.FrmType.Column4Frm ||
                    (BP.Sys.FrmType)(this.FrmType) == BP.Sys.FrmType.SLFrm)
                {
                    this.Pub1.AddTD("表单生成方式");
                    this.Pub1.AddTDBegin("colspan=2");
                    rb           = new RadioButton();
                    rb.ID        = "RB_FrmGenerMode_0";
                    rb.Text      = "直接生成表单";
                    rb.Checked   = true;
                    rb.GroupName = "s2s";
                    this.Pub1.Add(rb);
                    this.Pub1.AddBR();

                    rb           = new RadioButton();
                    rb.ID        = "RB_FrmGenerMode_1";
                    rb.Text      = "从ccfrom云表单库中选择一个表单模版导入";
                    rb.GroupName = "s2s";
                    this.Pub1.Add(rb);
                    this.Pub1.AddBR();

                    rb           = new RadioButton();
                    rb.ID        = "RB_FrmGenerMode_2";
                    rb.Text      = "从本机或其他数据库的的表导入表结构";
                    rb.GroupName = "s2s";
                    this.Pub1.Add(rb);
                    this.Pub1.AddBR();
                }
                //ExcelFrm,WordFrm 只保留上传
                if ((BP.Sys.FrmType)(this.FrmType) == BP.Sys.FrmType.ExcelFrm ||
                    (BP.Sys.FrmType)(this.FrmType) == BP.Sys.FrmType.WordFrm)
                {
                    this.Pub1.AddTD("<font color='Red'>*</font>上传" + se.Lab + "(默认模版)");
                    this.Pub1.AddTDBegin("colspan=2");

                    FileUpload fUp = new FileUpload();
                    fUp.ID    = "fUpFrm";
                    fUp.Width = 300;

                    this.Pub1.Add("&nbsp;&nbsp;&nbsp;");
                    this.Pub1.Add(fUp);
                }
                this.Pub1.AddTDEnd();
            }
            else
            {
                this.Pub1.AddTD("<font color='Red'>*</font>表单Url");
                this.Pub1.AddTDBegin("colspan=2");
                tb         = new TextBox();
                tb.ID      = "TB_Url";
                tb.Columns = 40;

                this.Pub1.Add(tb);
                this.Pub1.Add("&nbsp;&nbsp;&nbsp;请正确填写表单链接,支持全局变量@Ho");
                this.Pub1.AddTDEnd();
            }
            this.Pub1.AddTREnd();


            //  //ExcelFrm,WordFrm 只保留上传
            //if ((BP.Sys.FrmType)(this.FrmType) == BP.Sys.FrmType.ExcelFrm ||
            //    (BP.Sys.FrmType)(this.FrmType) == BP.Sys.FrmType.WordFrm)
            //{
            //    this.Pub1.AddTRend();
            //    this.Pub1.AddTREnd();
            //}

            #endregion 表单生成方式.

            #region 操作按钮放到table中,布局缩放不会乱
            this.Pub1.AddTR();
            this.Pub1.AddTDBegin(" colspan='3' ");

            Button btn = new Button();
            btn.ID     = "Btn_Save";
            btn.Text   = "下一步";
            btn.Click += new EventHandler(BindStep1_Click);
            this.Pub1.Add(btn);
            this.Pub1.Add("<input type='button' value='返回上一步' onclick='Back();' />");

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            #endregion

            this.Pub1.AddTableEnd();
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Page.Title = "特性集";
            this.BindLeft();
            if (this.DoType == null)
            {
                this.Pub2.AddFieldSet("帮助", " 特性集就是整个流程节点中的特定属性批量的修改。");
                return;
            }

            this.Pub2.AddFieldSet("编辑:" + this.Lab);
            this.Pub2.AddTable("border=0");
            this.Pub2.AddTR();
            switch (this.DoType)
            {
            case "Base":
                this.Pub2.AddTDTitle("步骤");
                this.Pub2.AddTDTitle("节点名称");
                this.Pub2.AddTDTitle("是否可以退回");
                this.Pub2.AddTDTitle("是否可删除");
                this.Pub2.AddTDTitle("是否可转发");
                this.Pub2.AddTDTitle("允许分配工作否?");
                this.Pub2.AddTDTitle("是否可以查看工作报告?");
                this.Pub2.AddTDTitle("是否是保密步骤?");
                break;

            case "FormType":
                this.Pub2.AddTDTitle("步骤");
                this.Pub2.AddTDTitle("节点名称");
                this.Pub2.AddTDTitle("类型");
                this.Pub2.AddTDTitle("URL");
                break;

            default:
                this.Pub2.AddTDTitle("步骤");
                this.Pub2.AddTDTitle("节点名称");
                this.Pub2.AddTDTitle(this.Lab);
                break;
            }
            this.Pub2.AddTREnd();

            BP.WF.Template.NodeSheets nds = new BP.WF.Template.NodeSheets();
            nds.Retrieve("FK_Flow", this.FK_Flow);

            BP.WF.Template.NodeSheet mynd = new BP.WF.Template.NodeSheet();
            Attr attr = null;

            try
            {
                attr = mynd.EnMap.GetAttrByKey(this.DoType);
            }
            catch
            {
            }

            foreach (BP.WF.Template.NodeSheet nd in nds)
            {
                if (this.FK_Node == nd.NodeID)
                {
                    this.Pub2.AddTR1();
                }
                else
                {
                    this.Pub2.AddTR();
                }

                switch (this.DoType)
                {
                case "Base":
                    break;

                case "FormType":
                    this.Pub2.AddTDIdx(nd.Step);
                    this.Pub2.AddTD(nd.Name);
                    BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                    ddl.ID = "DDL_" + nd.NodeID;
                    ddl.BindSysEnum("NodeFormType", nd.GetValIntByKey(NodeAttr.FormType));
                    this.Pub2.AddTD(ddl);
                    TextBox mytbURL = new TextBox();
                    mytbURL.ID      = "TB_" + nd.NodeID;
                    mytbURL.Text    = nd.GetValStringByKey(NodeAttr.FormUrl);
                    mytbURL.Columns = 50;
                    this.Pub2.AddTD(mytbURL);
                    break;

                default:
                    this.Pub2.AddTDIdx(nd.Step);
                    this.Pub2.AddTD(nd.Name);
                    switch (attr.UIContralType)
                    {
                    case UIContralType.TB:
                        TextBox mytb = new TextBox();
                        mytb.ID      = "TB_" + nd.NodeID;
                        mytb.Text    = nd.GetValStringByKey(this.DoType);
                        mytb.Columns = 50;
                        this.Pub2.AddTD(mytb);
                        break;

                    case UIContralType.CheckBok:
                        CheckBox mycb = new CheckBox();
                        mycb.ID      = "CB_" + nd.NodeID;
                        mycb.Text    = attr.Desc;
                        mycb.Checked = nd.GetValBooleanByKey(this.DoType);
                        this.Pub2.AddTD(mycb);
                        break;

                    case UIContralType.DDL:
                        BP.Web.Controls.DDL ddlm = new BP.Web.Controls.DDL();
                        ddlm.ID = "DDL_" + nd.NodeID;
                        ddlm.BindSysEnum(attr.UIBindKey, nd.GetValIntByKey(this.DoType));
                        this.Pub2.AddTD(ddlm);
                        break;

                    default:
                        break;
                    }
                    break;
                }
                this.Pub2.AddTREnd();
            }
            this.Pub2.AddTableEndWithHR();
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.Text     = "保存";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub2.Add(btn);
            this.Pub2.AddFieldSetEnd();
        }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FrmAttachment ath = new FrmAttachment();

            ath.MyPK = this.FK_MapData + "_" + this.Ath;
            if (this.Ath != null)
            {
                ath.RetrieveFromDBSources();
            }

            ath.FK_MapData = this.FK_MapData;
            ath.NoOfObj    = this.Ath;
            ath.MyPK       = this.FK_MapData + "_" + this.Ath;

            //this.Response.Write(this.Ath);
            //this.Response.Write("  -- "+this.FK_MapData);

            this.Title = "附件属性设置";

            this.Pub1.AddTable();
            //this.Pub1.AddCaptionLeft("附件");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("项目");
            this.Pub1.AddTDTitle("采集");
            this.Pub1.AddTDTitle("说明");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("编号");
            TextBox tb = new TextBox();

            tb.ID   = "TB_" + FrmAttachmentAttr.NoOfObj;
            tb.Text = ath.NoOfObj;
            if (this.Ath != null)
            {
                tb.Enabled = false;
            }

            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("标示号只能英文字母数字或下滑线.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("名称");
            tb      = new TextBox();
            tb.ID   = "TB_" + FrmAttachmentAttr.Name;
            tb.Text = ath.Name;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("附件的中文名称.");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTD("文件格式");
            tb      = new TextBox();
            tb.ID   = "TB_" + FrmAttachmentAttr.Exts;
            tb.Text = ath.Exts;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("实例:doc,docx,xls,多种格式用逗号分开.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("保存到");
            tb         = new TextBox();
            tb.ID      = "TB_" + FrmAttachmentAttr.SaveTo;
            tb.Text    = ath.SaveTo;
            tb.Columns = 60;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("类别");
            tb         = new TextBox();
            tb.ID      = "TB_" + FrmAttachmentAttr.Sort;
            tb.Text    = ath.Sort;
            tb.Columns = 60;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=3", "帮助:类别可以为空,设置的格式为:类别名1,类别名2,类别名3");
            this.Pub1.AddTREnd();

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

            cb.ID      = "CB_" + FrmAttachmentAttr.IsDownload;
            cb.Text    = "是否可下载";
            cb.Checked = ath.IsDownload;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("");
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsDelete;
            cb.Text    = "是否可删除";
            cb.Checked = ath.IsDelete;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("");
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsUpload;
            cb.Text    = "是否可上传";
            cb.Checked = ath.IsUpload;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("");
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsNote;
            cb.Text    = "是否增加备注列";
            cb.Checked = ath.IsNote;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();



            this.Pub1.AddTR();
            this.Pub1.AddTD("高度");
            BP.Web.Controls.TB mytb = new BP.Web.Controls.TB();
            mytb.ID       = "TB_" + FrmAttachmentAttr.H;
            mytb.Text     = ath.H.ToString();
            mytb.ShowType = BP.Web.Controls.TBType.Float;
            this.Pub1.AddTD("colspan=1", mytb);
            this.Pub1.AddTD("对傻瓜表单有效");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("宽度");
            mytb          = new BP.Web.Controls.TB();
            mytb.ID       = "TB_" + FrmAttachmentAttr.W;
            mytb.Text     = ath.W.ToString();
            mytb.ShowType = BP.Web.Controls.TBType.Float;
            mytb.Columns  = 60;
            this.Pub1.AddTD("colspan=1", mytb);
            this.Pub1.AddTD("对傻瓜表单有效");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTD("自动控制");
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsAutoSize;
            cb.Text    = "自动控制高度与宽度(对傻瓜表单有效)";
            cb.Checked = ath.IsAutoSize;
            this.Pub1.AddTD("colspan=2", cb);
            this.Pub1.AddTREnd();

            GroupFields gfs = new GroupFields(ath.FK_MapData);

            this.Pub1.AddTR1();
            this.Pub1.AddTD("显示在分组");
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_GroupField";
            ddl.BindEntities(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab, false, BP.Web.Controls.AddAllLocation.None);
            ddl.SetSelectItem(ath.GroupID);
            this.Pub1.AddTD("colspan=2", ddl);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("");
            Button btn = new Button();

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

            if (this.Ath != null)
            {
                btn          = new Button();
                btn.ID       = "Btn_Delete";
                btn.Text     = "  Delete  ";
                btn.CssClass = "Btn";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Click);
                this.Pub1.AddTD(btn);
            }
            else
            {
                this.Pub1.AddTD();
            }
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Example #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FindWorkerRole en = new FindWorkerRole();

            en.OID = this.RefOID;
            if (en.OID != 0)
            {
                en.Retrieve();
            }

            if (this.RefOID != 0 && this.S1 == null)
            {
                if (en.SortVal1 != "0")
                {
                    this.Response.Redirect("ByDept.aspx?S1=" + en.SortVal1 + "&RefOID=" + this.RefOID + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node, true);
                    return;
                }
            }
            #region 1级


            this.UCS1.AddFieldSet("部门设置类型");
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID           = "DDL_S1"; // 第一纬度.
            ddl.AutoPostBack = true;
            ddl.Items.Add(new ListItem("按职务指定", "0"));
            ddl.Items.Add(new ListItem("按岗位指定", "1"));
            ddl.Items.Add(new ListItem("指定部门的所有成员", "2"));
            if (this.S1 != null)
            {
                en.SortVal1 = this.S1;
            }

            if (string.IsNullOrEmpty(en.SortVal1))
            {
                en.SortVal1 = "0";
            }

            ddl.SetSelectItem(en.SortVal1);

            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.UCS1.Add("选择");
            this.UCS1.Add(ddl);
            #endregion 2级

            #region 2级
            this.UCS2.AddFieldSet("选择部门.");
            this.UCS2.Add("部门");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_V1"; // 第一个纬度的参数.
            ddl.BindSQL("SELECT No,Name  FROM Port_Dept   ORDER BY No ",
                        "No", "Name", BP.Web.WebUser.FK_Dept);
            this.UCS2.Add(ddl);
            ddl.SetSelectItem(en.TagVal1); // 第2纬度的参数.
            this.UCS2.AddFieldSetEnd();
            #endregion 2级

            #region 2级
            if (en.SortVal1 == "0")
            {
                this.UCS2.AddFieldSet("选择职务.");
                this.UCS2.Add("职务");
                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_V2"; // 第一个纬度的参数.
                ddl.BindSQL("SELECT No,Name  FROM Port_Duty   ORDER BY No ",
                            "No", "Name", "01");
                this.UCS2.Add(ddl);
                ddl.SetSelectItem(en.TagVal2); // 第3纬度的参数.
                this.UCS2.AddFieldSetEnd();
            }

            if (en.SortVal1 == "1")
            {
                this.UCS2.AddFieldSet("选择岗位.");
                this.UCS2.Add("岗位");
                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_V2"; // 第一个纬度的参数.
                ddl.BindSQL("SELECT No,Name  FROM Port_Station   ORDER BY No ",
                            "No", "Name", "01");
                this.UCS2.Add(ddl);
                ddl.SetSelectItem(en.TagVal2); // 第3纬度的参数.
                this.UCS2.AddFieldSetEnd();
            }
            #endregion 2级

            Button btn = new Button();
            btn.ID     = "Btn_Save";
            btn.Text   = "保存";
            btn.Click += new EventHandler(btn_Click);
            this.UCS3.Add(btn);
        }
        /// <summary>
        /// 设置数据
        /// </summary>
        /// <param name="en"></param>
        public void SetCtrlValues(Entity en)
        {
            Attrs attrs = en.EnMap.Attrs;

            foreach (System.Web.UI.Control ctl in this.Controls)
            {
                #region 排除非预定的控件
                if (ctl == null || string.IsNullOrEmpty(ctl.ID))
                {
                    continue;
                }

                string id = ctl.ID;
                if (id.Contains("TB_") || id.Contains("CB_") || id.Contains("DDL_"))
                {
                    /*约定的控件*/
                }
                else
                {
                    continue;
                }
                #endregion 排除非预定的控件

                #region 设置控件信息。
                foreach (Attr attr in attrs)
                {
                    string myID = "TB_" + attr.Key;
                    if (myID == id)
                    {
                        TextBox tb = ctl as TextBox;
                        if (tb != null)
                        {
                            tb.Text      = en.GetValStrByKey(attr.Key);
                            tb.MaxLength = attr.MaxLength;
                            continue;
                        }

                        BP.Web.Controls.TB tbSelf = ctl as BP.Web.Controls.TB;
                        if (tbSelf != null)
                        {
                            tbSelf.Text  = en.GetValStrByKey(attr.Key);
                            tb.MaxLength = attr.MaxLength;
                            continue;
                        }
                    }

                    myID = "DDL_" + attr.Key;
                    if (myID == id)
                    {
                        DropDownList ddl = ctl as DropDownList;
                        if (ddl != null)
                        {
                            if (ddl.Items.Count == 0)
                            {
                                if (attr.IsEnum)
                                {
                                    BP.Web.Ctrl.Glo.DDL_BindEnum(ddl, attr.UIBindKey, en.GetValIntByKey(attr.Key));
                                }

                                if (attr.IsFK)
                                {
                                    BP.Web.Ctrl.Glo.DDL_BindEns(ddl, attr.UIBindKey, en.GetValStrByKey(attr.Key));
                                }
                            }

                            foreach (ListItem li in ddl.Items)
                            {
                                li.Selected = false;
                            }

                            string val = en.GetValStrByKey(attr.Key);
                            foreach (ListItem li in ddl.Items)
                            {
                                if (li.Value == val)
                                {
                                    li.Selected = true;
                                    break;
                                }
                            }

                            //try
                            //{
                            //    ddl.SelectedValue = val;
                            //    continue;
                            //}
                            //catch(Exception ex)
                            //{
                            //    throw new Exception(ex.Message+" - "+val);
                            //}
                        }

                        BP.Web.Controls.DDL ddlSelf = ctl as BP.Web.Controls.DDL;
                        if (ddlSelf != null)
                        {
                            ddlSelf.SetSelectItem(en.GetValStrByKey(attr.Key));
                            continue;
                        }
                    }


                    myID = "CB_" + attr.Key;
                    if (myID == id)
                    {
                        CheckBox cb = ctl as CheckBox;
                        if (cb != null)
                        {
                            if (en.GetValIntByKey(attr.Key) == 1)
                            {
                                cb.Checked = true;
                            }
                            else
                            {
                                cb.Checked = false;
                            }
                            continue;
                        }
                    }
                }
                #endregion 设置控件信息。
            }
        }
Example #14
0
        private void BindExpImp()
        {
            MapDtl dtl = new MapDtl(this.FK_MapDtl);

            if (this.Request.QueryString["Flag"] == "ExpTemplete")
            {
                string file = this.Request.PhysicalApplicationPath + @"\DataUser\DtlTemplete\" + this.FK_MapDtl + ".xls";
                if (System.IO.File.Exists(file) == false)
                {
                    this.WinCloseWithMsg("设计错误:流程设计人员没有把该导入的从表模版放入" + file);
                    return;
                }
                BP.Sys.PubClass.OpenExcel(file, dtl.Name + ".xls");
                this.WinClose();
            }

            if (this.Request.QueryString["Flag"] == "ExpTemplete")
            {
                string file = this.Request.PhysicalApplicationPath + @"\DataUser\DtlTemplete\" + this.FK_MapDtl + ".xls";
                if (System.IO.File.Exists(file) == false)
                {
                    this.WinCloseWithMsg("设计错误:流程设计人员没有把该导入的从表模版放入" + file);
                    return;
                }
                BP.Sys.PubClass.OpenExcel(file, dtl.Name + ".xls");
                this.WinClose();
                return;
            }

            if (this.Request.QueryString["Flag"] == "ExpData")
            {
                GEDtls dtls = new GEDtls(this.FK_MapDtl);
                dtls.Retrieve(GEDtlAttr.RefPK, this.WorkID);
                this.ExportDGToExcelV2(dtls, dtl.No + ".xls");
                this.WinClose();
                return;
            }

            if (dtl.IsExp)
            {
                this.Pub1.AddFieldSet("数据导出");
                this.Pub1.Add("点下面的连接进行本从表的导出,您可以根据列的需要增减列。");
                string urlExp = "DtlOpt.aspx?DoType=" + this.DoType + "&WorkID=" + this.WorkID + "&FID=" + this.FID + "&FK_MapDtl=" + this.FK_MapDtl + "&Flag=ExpData";
                this.Pub1.Add("<a href='" + urlExp + "' target=_blank ><img src='../Img/FileType/xls.gif' border=0 /><b>导出数据</b></a>");
                this.Pub1.AddFieldSetEnd();
            }

            if (dtl.IsImp)
            {
                this.Pub1.AddFieldSet("通过Excel导入:" + dtl.Name);
                this.Pub1.Add("下载数据模版:利用数据模板导出一个数据模板,您可以在此基础上进行数据编辑,把编辑好的信息<br>在通过下面的功能导入进来,以提高工作效率。");
                string url = "DtlOpt.aspx?DoType=" + this.DoType + "&WorkID=" + this.WorkID + "&FID=" + this.FID + "&FK_MapDtl=" + this.FK_MapDtl + "&Flag=ExpTemplete";
                this.Pub1.Add("<a href='" + url + "' target=_blank ><img src='../Img/FileType/xls.gif' border=0 />数据模版</a>");
                this.Pub1.Add("<br>");

                this.Pub1.Add("格式数据文件:");
                System.Web.UI.WebControls.FileUpload fu = new System.Web.UI.WebControls.FileUpload();
                fu.ID = "fup";
                this.Pub1.Add(fu);

                BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                ddl.Items.Add(new ListItem("选择导入方式", "all"));
                ddl.Items.Add(new ListItem("清空方式", "0"));
                ddl.Items.Add(new ListItem("追加方式", "1"));
                ddl.ID = "DDL_ImpWay";
                this.Pub1.Add(ddl);

                Button btn = new Button();
                btn.Text     = "导入";
                btn.CssClass = "Btn";
                btn.ID       = "Btn_" + dtl.No;
                btn.Click   += new EventHandler(btn_Click);
                this.Pub1.Add(btn);
                this.Pub1.AddFieldSetEnd();
            }

            if (dtl.IsEnableSelectImp)
            {
                this.Pub1.AddFieldSet("从数据源导入:" + dtl.Name);
                this.Pub1.Add("进入列表,选择一个或者多个记录,然后点确定按钮,执行导入。");
                string url = "DtlOpSelectItems.aspx?DoType=" + this.DoType + "&WorkID=" + this.WorkID + "&FID=" + this.FID + "&FK_MapDtl=" + this.FK_MapDtl + "&Flag=ExpTemplete";
                this.Pub1.Add("<a href='" + url + "' target=_self ><img src='../Img/Table.gif' border=0 /><b>进入....</b></a>");
                this.Pub1.AddFieldSetEnd();
            }
        }
Example #15
0
        public void BindSFTable(SFTable en)
        {
            bool   isItem = false;
            string star   = "<font color=red><b>(*)</b></font>";

            this.Ucsys1.AddTable();

            #region 生成标题.
            if (this.FromApp == "SL")
            {
                if (this.RefNo == null)
                {
                    this.Ucsys1.AddCaption("新建表");
                }
                else
                {
                    this.Ucsys1.AddCaption("编辑表");
                }
            }
            else
            {
                if (this.RefNo == null)
                {
                    this.Ucsys1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'><img src='/WF/Img/Btn/Back.gif'>返回</a> - <a href='Do.aspx?DoType=AddSFSQL&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>外部表</a> - 新建表");
                }
                else
                {
                    this.Ucsys1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'><img src='/WF/Img/Btn/Back.gif'>返回</a> - <a href='Do.aspx?DoType=AddSFSQL&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>外部表</a> - 编辑表");
                }
            }

            if (this.RefNo == null)
            {
                this.Title = "新建表";
            }
            else
            {
                this.Title = "编辑表";
            }

            #endregion 生成标题.

            int idx = 0;
            this.Ucsys1.AddTR();
            this.Ucsys1.AddTDTitle("Idx");
            this.Ucsys1.AddTDTitle("项目");
            this.Ucsys1.AddTDTitle("采集");
            this.Ucsys1.AddTDTitle("备注");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("数据源" + star);

            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_FK_SFDBSrc";

            SFDBSrcs srcs = new SFDBSrcs();
            srcs.RetrieveDBSrc();

            ddl.Bind(srcs, en.FK_SFDBSrc);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("选择数据源,点击这里<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs')\">创建</a>,<a href='SFSQL.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx='>刷新</a>。");
            this.Ucsys1.AddTREnd();


            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("中文名称" + star);
            BP.Web.Controls.TB tb = new BP.Web.Controls.TB();
            tb.ID           = "TB_" + SFTableAttr.Name;
            tb.Text         = en.Name;
            tb.Columns      = 35;
            tb.AutoPostBack = true;
            tb.TextChanged += new EventHandler(tbName_TextChanged);
            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTD("该表的中文名称,比如:物料类别,科目。");
            this.Ucsys1.AddTREnd();


            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("英文名称" + star);
            tb      = new BP.Web.Controls.TB();
            tb.ID   = "TB_" + SFTableAttr.No;
            tb.Text = en.No;
            if (this.RefNo == null)
            {
                tb.Enabled = true;
            }
            else
            {
                tb.Enabled = false;
            }

            if (tb.Text == "")
            {
                tb.Text = "";
            }
            tb.Columns = 35;
            tb.Attributes["onkeyup"] = "return IsDigit(this);";


            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTDBigDoc("必须以字母或者下划线开头,不能包含特殊字符。");
            this.Ucsys1.AddTREnd();


            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("数据结构");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + SFTableAttr.CodeStruct;
            ddl.BindSysEnum(SFTableAttr.CodeStruct, (int)en.CodeStruct);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("字典表的数据结构,用于在下拉框中不同格式的展现。");
            this.Ucsys1.AddTREnd();

            //isItem = this.Ucsys1.AddTR(isItem);
            //this.Ucsys1.AddTDIdx(idx++);
            //this.Ucsys1.AddTD("描述");
            //tb = new BP.Web.Controls.TB();
            //tb.ID = "TB_"+SFTableAttr.TableDesc;
            //tb.Text = en.TableDesc;
            //this.Ucsys1.AddTD(tb);
            //this.Ucsys1.AddTD("对该表的备注,比如:物料类别字典表,科目字典表。");
            //this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("colspan=3", "查询SQL" + star + "支持ccform表达式,允许有@WebUser.No,@WebUser.Name,@WebUser.FK_Dept变量。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            tb          = new BP.Web.Controls.TB();
            tb.ID       = "TB_" + SFTableAttr.SelectStatement; //查询.
            tb.Text     = en.SelectStatement;                  //查询语句.
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 4;
            tb.Columns  = 70;
            //tb.Attributes["width"] = "98%";
            this.Ucsys1.AddTD("colspan=3", tb);
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("colspan=3", "比如:SELECT BH AS No, MC as Name FROM CC_USER WHERE CCType=3<br>SELECT BH AS No, MC as Name FROM CC_USER WHERE [email protected]_Dept");
            this.Ucsys1.AddTREnd();

            //isItem = this.Ucsys1.AddTR(isItem);
            //this.Ucsys1.AddTDIdx(idx++);
            //this.Ucsys1.AddTD("数据缓存(分钟)" + star);
            //tb = new BP.Web.Controls.TB();
            //tb.ID = "TB_"+SFTableAttr.CashMinute;
            //tb.TextExtInt = en.CashMinute;
            //tb.Columns = 5;
            //this.Ucsys1.AddTD(tb);
            //this.Ucsys1.AddTD("默认为0表示不缓存,缓存的数据存储在Sys_Dict里面.");
            //this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.Add("<TD colspan=3 align=center>");
            Button btn = new Button();
            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            if (this.RefNo == null)
            {
                btn.Text = "创建";
            }
            else
            {
                btn.Text = "保存";
            }
            btn.Click += new EventHandler(btn_Save_Click);
            this.Ucsys1.Add(btn);

            //btn = new Button();
            //btn.ID = "Btn_Edit";
            //btn.CssClass = "Btn";
            //btn.Text =  "查看数据"; // "编辑数据"
            //if (this.RefNo == null)
            //    btn.Enabled = false;
            //if (en.IsClass)
            //    btn.Attributes["onclick"] = "WinOpen('../Search.aspx?EnsName=" + en.No + "','dg' ); return false;";
            //else
            //    btn.Attributes["onclick"] = "WinOpen('SFTableEditData.aspx?RefNo=" + this.RefNo + "','dg' ); return false;";
            //this.Ucsys1.Add(btn);

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

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

            btn.Click += new EventHandler(btn_Del_Click);
            this.Ucsys1.Add(btn);
            this.Ucsys1.Add("</TD>");
            this.Ucsys1.AddTREnd();
            this.Ucsys1.AddTableEnd();

            //string help = "<ul>";
            //help += "<li>输入:新表名或已经存在的表名或者视图,必须是英文字母或者下划线。</li>";
            //help += "<li>如果该表或者视图已经存在本机中,系统就会把他注册到ccform的数据源(Sys_SFTable)里,您可以打开Sys_SFTable查看ccform对外部数据源管理的信息。</li>";
            //help += "<li>如果不存在ccform就会自动创建表,该表有No,Name两个列,并且初始化3笔数据,您可以对该表进行编辑。</li>";
            //help += "</ul>";
            //this.Ucsys1.AddFieldSet("帮助", help);
        }
Example #16
0
        void btn_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;

            try
            {
                BP.Web.Controls.DDL DDL_ImpWay            = (BP.Web.Controls.DDL) this.Pub1.FindControl("DDL_ImpWay");
                System.Web.UI.WebControls.FileUpload fuit = (System.Web.UI.WebControls.FileUpload) this.Pub1.FindControl("fup");
                if (DDL_ImpWay.SelectedIndex == 0)
                {
                    this.Alert("请选择导入方式.");
                    return;
                }

                MapDtl dtl  = new MapDtl(this.FK_MapDtl);
                string file = this.Request.PhysicalApplicationPath + "\\Temp\\" + WebUser.No + ".xls";
                fuit.SaveAs(file);

                GEDtls dtls = new GEDtls(this.FK_MapDtl);
                System.Data.DataTable dt = BP.DBLoad.GetTableByExt(file);

                file = this.Request.PhysicalApplicationPath + "\\DataUser\\DtlTemplete\\" + this.FK_MapDtl + ".xls";
                System.Data.DataTable dtTemplete = BP.DBLoad.GetTableByExt(file);

                #region 检查两个文件是否一致。
                foreach (DataColumn dc in dtTemplete.Columns)
                {
                    bool isHave = false;
                    foreach (DataColumn mydc in dt.Columns)
                    {
                        if (dc.ColumnName == mydc.ColumnName)
                        {
                            isHave = true;
                            break;
                        }
                    }
                    if (isHave == false)
                    {
                        throw new Exception("@您导入的excel文件不符合系统要求的格式,请下载模版文件重新填入。");
                    }
                }
                #endregion 检查两个文件是否一致。


                #region 生成要导入的属性.

                BP.En.Attrs attrs    = dtls.GetNewEntity.EnMap.Attrs;
                BP.En.Attrs attrsExp = new BP.En.Attrs();
                foreach (DataColumn dc in dtTemplete.Columns)
                {
                    foreach (Attr attr in attrs)
                    {
                        if (attr.UIVisible == false)
                        {
                            continue;
                        }

                        if (attr.IsRefAttr)
                        {
                            continue;
                        }

                        if (attr.Desc == dc.ColumnName.Trim())
                        {
                            attrsExp.Add(attr);
                            break;
                        }
                    }
                }
                #endregion 生成要导入的属性.


                #region 执行导入数据.
                if (DDL_ImpWay.SelectedIndex == 1)
                {
                    BP.DA.DBAccess.RunSQL("DELETE " + dtl.PTable + " WHERE RefPK='" + this.WorkID + "'");
                }

                int    i   = 0;
                Int64  oid = BP.DA.DBAccess.GenerOID(this.FK_MapDtl, dt.Rows.Count);
                string rdt = BP.DA.DataType.CurrentData;
                foreach (DataRow dr in dt.Rows)
                {
                    GEDtl dtlEn = dtls.GetNewEntity as GEDtl;
                    dtlEn.ResetDefaultVal();

                    foreach (BP.En.Attr attr in attrsExp)
                    {
                        if (attr.UIVisible == false || dr[attr.Desc] == DBNull.Value)
                        {
                            continue;
                        }

                        string val = dr[attr.Desc].ToString();
                        if (val == null)
                        {
                            continue;
                        }
                        val = val.Trim();
                        switch (attr.MyFieldType)
                        {
                        case FieldType.Enum:
                        case FieldType.PKEnum:
                            SysEnums ses = new SysEnums(attr.UIBindKey);
                            foreach (SysEnum se in ses)
                            {
                                if (val == se.Lab)
                                {
                                    val = se.IntKey.ToString();
                                    break;
                                }
                            }
                            break;

                        case FieldType.FK:
                        case FieldType.PKFK:
                            break;

                        default:
                            break;
                        }

                        dtlEn.SetValByKey(attr.Key, val);
                    }
                    dtlEn.RefPKInt = (int)this.WorkID;
                    dtlEn.SetValByKey("RDT", rdt);
                    dtlEn.SetValByKey("Rec", WebUser.No);
                    i++;
                    dtlEn.InsertAsOID(oid);
                    oid++;
                }
                #endregion 执行导入数据.

                this.Alert("共有(" + i + ")条数据导入成功。");
            }
            catch (Exception ex)
            {
                string msg = ex.Message.Replace("'", "‘");
                this.Alert(msg);
            }
        }
Example #17
0
        public void BindSFTable(SFTable en)
        {
            bool   isItem = false;
            string star   = "<font color=red><b>(*)</b></font>";

            this.Ucsys1.AddTable();

            #region 生成标题.
            if (this.FromApp == "SL")
            {
                if (this.RefNo == null)
                {
                    this.Ucsys1.AddCaption("新建WebService数据源接口");
                }
                else
                {
                    this.Ucsys1.AddCaption("编辑WebService数据源接口");
                }
            }
            else
            {
                this.Ucsys1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'><img src='/WF/Img/Btn/Back.gif'>返回</a> - <a href='Do.aspx?DoType=AddSFWS&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>WebService数据源接口</a> - 新建WebService数据源接口");
            }

            if (this.RefNo == null)
            {
                this.Title = "新建WebService数据源接口";
            }
            else
            {
                this.Title = "编辑WebService数据源接口";
            }

            #endregion 生成标题.

            int idx = 0;
            this.Ucsys1.AddTR();
            this.Ucsys1.AddTDTitle("Idx");
            this.Ucsys1.AddTDTitle("项目");
            this.Ucsys1.AddTDTitle("采集");
            this.Ucsys1.AddTDTitle("备注");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("接口英文名称" + star);
            var tb = new BP.Web.Controls.TB();
            tb.ID   = "TB_" + SFTableAttr.No;
            tb.Text = en.No;
            if (this.RefNo == null)
            {
                tb.Enabled = true;
            }
            else
            {
                tb.Enabled = false;
            }

            if (tb.Text == "")
            {
                tb.Text = "SF_";
            }

            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTDBigDoc("必须以字母或者下划线开头,不能包含特殊字符。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("接口中文名称" + star);
            tb      = new BP.Web.Controls.TB();
            tb.ID   = "TB_" + SFTableAttr.Name;
            tb.Text = en.Name;
            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTD("WebService中的接口方法的中文名称。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("数据源" + star);
            BP.Web.Controls.DDL ddl  = new BP.Web.Controls.DDL();
            SFDBSrcs            srcs = new SFDBSrcs();
            BP.En.QueryObject   qo   = new QueryObject(srcs);
            qo.AddWhere(SFDBSrcAttr.DBSrcType, " = ", "100");
            qo.DoQuery();
            ddl.Bind(srcs, en.FK_SFDBSrc);
            ddl.ID                    = "DDL_" + SFTableAttr.FK_SFDBSrc;
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("选择数据源,点击这里<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs')\">创建</a>,<a href='SFWS.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx='>刷新</a>。");
            this.Ucsys1.AddTREnd();

            var rt = en.TableDesc.Split(',');

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("选择接口" + star);
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + SFTableAttr.TableDesc;

            if (srcs.Count > 0)
            {
                var ms = GetWebServiceMethods(!string.IsNullOrWhiteSpace(en.FK_SFDBSrc) ? (SFDBSrc)srcs.GetEntityByKey(SFDBSrcAttr.No, en.FK_SFDBSrc) : (SFDBSrc)srcs[0]);

                foreach (var m in ms)
                {
                    ddl.Items.Add(new ListItem(m.Value, m.Key));
                }

                ddl.SetSelectItem(rt.Length == 2 ? rt[0] : ms.Count > 0 ? ms.First().Key : string.Empty);
            }

            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTDBigDoc("选择WebService中的接口方法名。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("colspan=3", "接口参数定义" + star + "支持ccform表达式,允许有@WebUser.No,@WebUser.Name,@WebUser.FK_Dept变量。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            tb          = new BP.Web.Controls.TB();
            tb.ID       = "TB_" + SFTableAttr.SelectStatement;
            tb.Text     = en.SelectStatement;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 3;
            tb.Columns  = 70;
            this.Ucsys1.AddTD("colspan=3", tb);
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("colspan=3", "如:WorkId=@WorkID&FK_Flow=@FK_Flow&FK_Node=@FK_Node&SearchType=1,带@的参数值在运行时自动使用发起流程的相关参数值替换,而不带@的参数值使用后面的赋值;参数个数与WebServices接口方法的参数个数一致,且顺序一致,且值均为字符类型。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("返回值类型" + star);
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_ResultType";

            ddl.Items.Add(new ListItem("DataTable数据表", "DataTable"));
            ddl.Items.Add(new ListItem("DataSet数据集", "DataSet"));
            ddl.Items.Add(new ListItem("Json字符串", "Json"));
            ddl.Items.Add(new ListItem("Xml字符串", "Xml"));

            if (rt.Length == 2)
            {
                ddl.SetSelectItem(rt[1]);
            }

            this.Ucsys1.AddTDBegin();
            this.Ucsys1.Add(ddl);
            this.Ucsys1.AddBR();
            this.Ucsys1.Add("注意:所有返回值类型都需有No,Name这两列。" +
                            "<script type='text/javascript'>" +
                            "   var info = '1. DataTable数据表,必须为DataTable命名。\\n" +
                            "2. DataSet数据集,只取数据集里面的第1个DataTable。\\n" +
                            "3. Json字符串,格式如:\\n" +
                            "[\\n" +
                            "  {\"No\":\"001\",\"Name\":\"生产部\"},\\n" +
                            "  {\"No\":\"002\",\"Name\":\"研发部\"},\\n" +
                            "  ...\\n" +
                            "]\\n" +
                            "4. Xml字符串,格式如:\\n" +
                            "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\\n" +
                            "<Array>\\n" +
                            "  <Item>\\n" +
                            "    <No>001</No>\\n" +
                            "    <Name>生产部</Name>\\n" +
                            "  </Item>\\n" +
                            "  <Item>\\n" +
                            "    <No>002</No>\\n" +
                            "    <Name>研发部</Name>\\n" +
                            "  </Item>\\n" +
                            "  ...\\n" +
                            "</Array>';" +
                            "</script>" +
                            "<a href='javascript:void(0)' onclick='alert(info)'>格式说明</a>");
            this.Ucsys1.AddTDEnd();
            this.Ucsys1.AddTDBigDoc("选择WebService中的接口方法返回值的类型。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("返回数据结构");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + SFTableAttr.CodeStruct;
            ddl.BindSysEnum(SFTableAttr.CodeStruct, (int)en.CodeStruct);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("WebService接口返回的数据结构,用于在下拉框中不同格式的展现。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.Add("<TD colspan=3 align=center>");
            Button btn = new Button();
            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            if (this.RefNo == null)
            {
                btn.Text = "创建";
            }
            else
            {
                btn.Text = "保存";
            }
            btn.Click += new EventHandler(btn_Save_Click);
            this.Ucsys1.Add(btn);

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

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

            btn.Click += new EventHandler(btn_Del_Click);
            this.Ucsys1.Add(btn);
            this.Ucsys1.Add("</TD>");
            this.Ucsys1.AddTREnd();
            this.Ucsys1.AddTableEnd();
        }
Example #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //没有指定父容器高宽,宽度100%不可用,
            //指定固定width,页面放大缩小,布局不会乱
            this.Pub1.AddTable(" style='width:100%;' ");
            this.Pub1.AddCaption("表单[" + md.Name + "]与流程[" + flow.Name + "]上全部节点的绑定");

            this.Pub1.AddTR();
            string thCenter = "' style='text-align:center;'";

            this.Pub1.AddTH(thCenter, "节点编号");
            this.Pub1.AddTH(thCenter, "是否绑定");
            this.Pub1.AddTH(thCenter, "可否编辑");
            this.Pub1.AddTH(thCenter, "可否打印");
            this.Pub1.AddTH(thCenter, "是否启用装载填充事件");
            this.Pub1.AddTH(thCenter, "权限控制方案");
            this.Pub1.AddTH(thCenter, "表单元素控制方案");
            this.Pub1.AddTH(thCenter, "谁是主键");
            this.Pub1.AddTREnd();


            int      idx = 1;
            FrmNode  fn  = null;
            CheckBox cb  = null;

            BP.Web.Controls.DDL ddl = null;

            #region 循环添加Node
            foreach (Node nd in nds)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(nd.NodeID);

                //检索出来的数据是唯一的
                fn = new FrmNode(this.FK_Flow,
                                 nd.NodeID, this.FK_MapData);

                cb      = new CheckBox();
                cb.ID   = "CB_NodeName_" + nd.NodeID;
                cb.Text = nd.Name;

                if (fn.FK_Node == nd.NodeID)
                {
                    cb.Checked = true;
                }
                else
                {
                    cb.Checked = false;
                }

                this.Pub1.AddTD(" ' style='with:100px;' ", cb);


                cb         = new CheckBox();
                cb.ID      = "CB_IsEdit_" + nd.NodeID;
                cb.Text    = "可否编辑";
                cb.Checked = fn.IsEdit;
                this.Pub1.AddTD(thCenter, cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsPrint_" + nd.NodeID;
                cb.Text    = "可否打印";
                cb.Checked = fn.IsPrint;
                this.Pub1.AddTD(thCenter, cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsEnableLoadData_" + nd.NodeID;
                cb.Text    = "是否启用";
                cb.Checked = fn.IsEnableLoadData;
                this.Pub1.AddTD(thCenter, cb);

                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_Sln_" + nd.NodeID;
                ddl.Items.Add(new ListItem("默认方案", "0"));
                ddl.Items.Add(new ListItem("自定义", nd.NodeID.ToString()));
                ddl.SetSelectItem(fn.FrmSln); //设置权限控制方案.
                this.Pub1.AddTD(thCenter, ddl);


                this.Pub1.AddTDBegin(" style='text-align:center;' ");
                this.Pub1.Add("<a href=\"javascript:WinField('" + md.No + "','" + nd.NodeID + "','" + this.FK_Flow + "')\" >字段</a>");
                this.Pub1.Add("-<a href=\"javascript:WinFJ('" + md.No + "','" + nd.NodeID + "','" + this.FK_Flow + "')\" >附件</a>");
                this.Pub1.Add("-<a href=\"javascript:WinDtl('" + md.No + "','" + nd.NodeID + "','" + this.FK_Flow + "')\" >从表</a>");

                if (md.HisFrmType == FrmType.ExcelFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarExcel('" + md.No + "','" + nd.NodeID + "','" + this.FK_Flow + "')\" >ToolbarExcel</a>");
                }

                if (md.HisFrmType == FrmType.WordFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarWord('" + md.No + "','" + nd.NodeID + "','" + this.FK_Flow + "')\" >ToolbarWord</a>");
                }

                this.Pub1.AddTDEnd();


                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_WhoIsPK_" + nd.NodeID;
                ddl.BindSysEnum("WhoIsPK");
                ddl.SetSelectItem((int)fn.WhoIsPK); //谁是主键?.
                this.Pub1.AddTD(thCenter, ddl);

                this.Pub1.AddTREnd();
                idx += 1;
            }
            #endregion  循环添加Node

            this.Pub1.AddTR();
            this.Pub1.AddTDBegin(" colspan='8' style='text-align:right;border:none;padding-top:20px;' ");

            Button btn = new Button();
            btn.ID       = "Save";
            btn.Text     = "保存";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SavePowerOrders_Click);

            this.Pub1.Add(btn);

            string text = "<input style='margin-left:20px;margin-right:40px;' type=button " +
                          "onclick=\"javascript:closeCurTab(\'" + md.Name + "\');\" value='关闭'  class=Btn />";
            this.Pub1.Add(text);

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Example #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapData md = new MapData(this.FK_MapData);

            this.Pub1.AddTable();
            //   this.Pub1.AddCaptionLeft("傻瓜表单属性");

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

            this.Pub1.AddTR();
            this.Pub1.AddTD("编号");
            this.Pub1.AddTD(this.FK_MapData);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("名称");
            TextBox tb = new TextBox();

            tb.ID   = "TB_" + MapDataAttr.Name;
            tb.Text = md.Name;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("表单主表");
            tb      = new TextBox();
            tb.ID   = "TB_" + MapDataAttr.PTable;
            tb.Text = md.PTable;

            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("显示宽度(单位px)");
            tb      = new TextBox();
            tb.ID   = "TB_" + MapDataAttr.TableWidth;
            tb.Text = md.GetValStringByKey(MapDataAttr.TableWidth);
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("如果设置为0 则认为是100%.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("表格呈现列数");
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_Col";
            ddl.Items.Add(new ListItem("4", "4"));
            ddl.Items.Add(new ListItem("6", "6"));
            ddl.Items.Add(new ListItem("8", "8"));
            ddl.Items.Add(new ListItem("10", "10"));
            ddl.Items.Add(new ListItem("12", "12"));
            ddl.SetSelectItem(md.TableCol);
            this.Pub1.AddTD(ddl);

            this.Pub1.AddTD("用于控制表单字段的横向布局.");
            this.Pub1.AddTREnd();

            if (md.No.Contains("ND") == true)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTD("审核组件");
                FrmWorkCheck fwc = new FrmWorkCheck(md.No);
                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_FWC";
                ddl.Items.Add(new ListItem("不可用", "0"));
                ddl.Items.Add(new ListItem("可填写", "1"));
                ddl.Items.Add(new ListItem("只读", "2"));
                ddl.SetSelectItem((int)fwc.HisFrmWorkCheckSta);
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTD("用户节点工作审核.");
                this.Pub1.AddTREnd();
            }

            //this.Pub1.AddTR();
            //this.Pub1.AddTD("表单权限控制方案");
            //tb = new TextBox();
            //tb.ID = "TB_" + MapDataAttr.Slns;
            //tb.Text = md.Slns;
            //tb.Columns = 60;
            //this.Pub1.AddTD("colspan=2", tb);
            //this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=3", "方案说明:格式为:@0=默认@1=第1套方案@2=第2套方案@3=第3套方案");
            this.Pub1.AddTREnd();

            this.Pub1.AddTableEnd();

            Button btn = new Button();

            btn.ID     = "Btn_Save";
            btn.Text   = "保存";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.Add(btn);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string   rpt   = "ND" + int.Parse(this.FK_Flow) + "Rpt";
            MapAttrs attrs = new MapAttrs(rpt);

            Flow fl = new Flow(this.FK_Flow);

            fl.RetrieveFromDBSources();

            fl.No = this.FK_Flow;
            if (string.IsNullOrEmpty(fl.DTSBTable) == true)
            {
                this.Pub1.AddFieldSet("配置错误", "请关闭该窗口,在流程属性里配置业务表名,然后点保存按钮,之后打开该功能界面。");
                return;
            }

            /*检查 用户设置的业务表是否正确,是否连接上.
             *
             * 1, sqlserver 比如: HR.dbo.Emps
             * 2, MySQL.
             * 3, Oracle  HR.Emps
             */


            //获取到业务表的字段名称.
            // 第1列,字段名。 第2列为中文名,第3类为类型.
            DataTable dt = BP.DA.DBAccess.GetTableSchema(fl.DTSBTable);

            this.Pub1.AddTable();
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("序");
            this.Pub1.AddTDTitle("是否同步");
            this.Pub1.AddTDTitle("字段描述");
            this.Pub1.AddTDTitle("类型");
            this.Pub1.AddTDTitle("业务表(" + fl.DTSBTable + ")");
            this.Pub1.AddTREnd();

            int idx = 0;

            Hashtable ht = new Hashtable();

            if (string.IsNullOrEmpty(fl.DTSFields))
            {
                fl.DTSFields = "@";
            }

            string[] fieldArray   = fl.DTSFields.Split('@');
            string[] lcFieldArray = fieldArray[0].Split(',');

            string[] ywFieldArray = fieldArray[1].Split(',');

            for (int i = 0; i < lcFieldArray.Length; i++)
            {
                ht.Add(lcFieldArray[i], ywFieldArray[i]);
            }

            string dtsFields = fl.DTSFields.Split('@')[0];

            foreach (MapAttr attr in attrs)
            {
                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);

                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + attr.KeyOfEn;
                cb.Text = attr.Name;

                foreach (DictionaryEntry de in ht)
                {
                    if (attr.KeyOfEn == de.Key.ToString())
                    {
                        cb.Checked = true;
                    }
                }

                this.Pub1.AddTD(cb);
                this.Pub1.AddTD(attr.KeyOfEn);
                this.Pub1.AddTD(attr.MyDataTypeStr);

                BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_" + attr.KeyOfEn;

                ddl.Bind(dt, "FNAME", "FNAME");
                if (cb.Checked == true)
                {
                    try
                    {
                        ddl.SetSelectItem(ht[attr.KeyOfEn].ToString());
                    }
                    catch (Exception)
                    {
                    }
                }
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();

            Button btn = new Button();

            btn.ID     = "Btn_Save";
            btn.Text   = "保存";
            btn.Click += new EventHandler(btn_Click);

            Button btnClose = new Button();

            btnClose.ID     = "Btn_Close";
            btnClose.Text   = "取消";
            btnClose.Click += new EventHandler(btnClose_Click);

            this.Pub1.Add(btn);
            this.Pub1.Add(btnClose);
        }
Example #21
0
        public void BindSFTable(SFTable en)
        {
            string star = "<font color=red><b>(*)</b></font>";

            this.Ucsys1.AddTable();

            if (this.FromApp == "SL")
            {
                if (this.RefNo == null)
                {
                    this.Ucsys1.AddCaption("新建表");
                }
                else
                {
                    this.Ucsys1.AddCaption("编辑表");
                }
            }
            else
            {
                if (this.RefNo == null)
                {
                    this.Ucsys1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'><img src='/WF/Img/Btn/Back.gif'>返回</a> - <a href='Do.aspx?DoType=AddSFTable&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>外键</a> - 新建表");
                }
                else
                {
                    this.Ucsys1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'><img src='/WF/Img/Btn/Back.gif'>返回</a> - <a href='Do.aspx?DoType=AddSFTable&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>外键</a> - 编辑表");
                }
            }

            if (this.RefNo == null)
            {
                this.Title = "新建表";
            }
            else
            {
                this.Title = "编辑表";
            }

            int  idx    = 0;
            bool isItem = false;

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTDTitle("Idx");
            this.Ucsys1.AddTDTitle("项目");
            this.Ucsys1.AddTDTitle("采集");


            // this.Ucsys1.AddFieldSet("帮助", help);

            this.Ucsys1.AddTDTitle("备注");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("数据源" + star);

            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_FK_SFDBSrc";
            SFDBSrcs srcs = new SFDBSrcs();

            srcs.RetrieveDBSrc();
            ddl.Bind(srcs, en.FK_SFDBSrc);
            this.Ucsys1.AddTD(ddl);

            //  this.Ucsys1.AddTD("外键表的数据源必须与该表单的数据源一致.");
            this.Ucsys1.AddTD("选择数据源,点击这里<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs')\">创建</a>,<a href='SFSQL.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx='>刷新</a>。");
            this.Ucsys1.AddTREnd();


            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("表中文名称" + star);
            BP.Web.Controls.TB tb = new BP.Web.Controls.TB();
            tb.ID           = "TB_Name";
            tb.Text         = en.Name;
            tb.AutoPostBack = true;
            tb.TextChanged += new EventHandler(tbName_TextChanged);
            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTD("该表的中文名称,比如:物料类别,科目。");
            this.Ucsys1.AddTREnd();


            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("表英文名称" + star);
            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;
            }

            if (tb.Text == "")
            {
                tb.Text = "";
            }

            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTDBigDoc("必须以字母或者下划线开头,不能包含特殊字符。");
            this.Ucsys1.AddTREnd();



            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("数据结构");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + SFTableAttr.CodeStruct;
            ddl.BindSysEnum(SFTableAttr.CodeStruct, (int)en.CodeStruct);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("用于在下拉框中不同格式的展现.");
            this.Ucsys1.AddTREnd();

            //isItem = this.Ucsys1.AddTR(isItem);
            //this.Ucsys1.AddTDIdx(idx++);
            //this.Ucsys1.AddTD("数据源" + star);
            //ddl = new BP.Web.Controls.DDL();
            //SFDBSrcs srcs = new SFDBSrcs();
            //BP.En.QueryObject qo = new QueryObject(srcs);
            //qo.AddWhere(SFDBSrcAttr.DBSrcType, " < ", "100");
            //qo.DoQuery();
            //ddl.Bind(srcs, en.FK_SFDBSrc);
            //this.Ucsys1.AddTD(ddl);
            //this.Ucsys1.AddTD("选择数据源,点击这里<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs')\">创建</a>,<a href='SFSQL.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx='>刷新</a>。");
            //this.Ucsys1.AddTREnd();


            //isItem = this.Ucsys1.AddTR(isItem);
            //this.Ucsys1.AddTDIdx(idx++);
            //this.Ucsys1.AddTD("描述" + star);
            //tb = new BP.Web.Controls.TB();
            //tb.ID = "TB_TableDesc";
            //tb.Text = en.TableDesc;
            //this.Ucsys1.AddTD(tb);
            //this.Ucsys1.AddTD("对该表的备注,比如:物料类别字典表,科目字典表。");
            //this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.Add("<TD colspan=3 align=center>");
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            if (this.RefNo == null)
            {
                btn.Text = "创建";
            }
            else
            {
                btn.Text = "保存";
            }

            btn.Click += new EventHandler(btn_Save_Click);
            this.Ucsys1.Add(btn);


            btn      = new Button();
            btn.ID   = "Btn_Edit";
            btn.Text = "编辑数据"; // "编辑数据"
            if (this.RefNo == null)
            {
                btn.Enabled = false;
            }
            if (en.IsClass)
            {
                btn.Attributes["onclick"] = "WinOpen('../Search.aspx?EnsName=" + en.No + "', 'dg'); return false;";
            }
            else
            {
                btn.Attributes["onclick"] = "WinOpen('SFTableEditData.aspx?RefNo=" + this.RefNo + "', 'dg'); return false;";
            }

            this.Ucsys1.Add(btn);

            if (this.FromApp != "SL")
            {
                btn          = new Button();
                btn.ID       = "Btn_Add";
                btn.CssClass = "Btn";

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

            this.Ucsys1.Add(btn);
            btn          = new Button();
            btn.ID       = "Btn_Del";
            btn.CssClass = "Btn";

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

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

            //string help = "<ul>";
            //help += "<li>输入:新表名或已经存在的表名或者视图,必须是英文字母或者下划线。</li>";
            //help += "<li>如果该表或者视图已经存在本机中,系统就会把他注册到ccform的数据源(Sys_SFTable)里,您可以打开Sys_SFTable查看ccform对外部数据源管理的信息。</li>";
            //help += "<li>如果不存在ccform就会自动创建表,该表有No,Name两个列,并且初始化3笔数据,您可以对该表进行编辑。</li>";
            //help += "</ul>";

            this.Ucsys1.Add(BP.WF.Glo.GenerHelpCCForm("帮助", null, null));

            this.Ucsys1.Add("</TD>");
            this.Ucsys1.AddTREnd();
            this.Ucsys1.AddTableEnd();
        }
Example #22
0
    public void SearchCond()
    {
        MapData  md            = new MapData(this.FK_MapData);
        MapAttrs attrs         = new MapAttrs(this.FK_MapData);
        MapAttrs attrsOfSearch = md.HisShowColsAttrs;

        #region 查询条件定义
        this.Pub2.AddH2("查询条件定义");

        this.Pub2.AddFieldSet("是否增加关键字查询");
        this.Pub2.Add("关键字查询是接受用户输入一个关键字,在整个表的列中用like 查询(外键、枚举、数值类型的除外)");
        this.Pub2.AddBR();
        CheckBox mycb = new CheckBox();
        mycb.ID      = "CB_IsSearchKey";
        mycb.Text    = "是否增加关键字查询";
        mycb.Checked = md.IsSearchKey;
        this.Pub2.Add(mycb);
        this.Pub2.AddFieldSetEnd();

        this.Pub2.AddFieldSet("外键与枚举类型");
        this.Pub2.Add("外键现枚举类型的数据才能进行下拉框查询,请选择要给查询。");
        this.Pub2.AddBR();

        foreach (MapAttr mattr in attrsOfSearch)
        {
            if (mattr.UIContralType != UIContralType.DDL)
            {
                continue;
            }

            CheckBox cb = new CheckBox();
            cb.ID = "CB_F_" + mattr.KeyOfEn;
            if (md.SearchKeys.Contains("@" + mattr.KeyOfEn))
            {
                cb.Checked = true;
            }

            cb.Text = mattr.Name + "(" + mattr.KeyOfEn + ")";
            this.Pub2.Add(cb);
            this.Pub2.AddBR();
        }
        this.Pub2.AddFieldSetEnd();

        bool isHave = false;
        foreach (MapAttr mattr in attrsOfSearch)
        {
            if (mattr.MyDataType == DataType.AppDate || mattr.MyDataType == DataType.AppDateTime)
            {
                isHave = true;
                break;
            }
        }

        if (isHave)
        {
            this.Pub2.AddFieldSet("时间段");
            this.Pub2.Add("对于数据进行按时间段的查询:比如对流程的发起时间进行发起时间从,到进行查询。");
            this.Pub2.AddBR();

            this.Pub2.Add("选择方式:");
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_DTSearchWay";
            ddl.BindSysEnum("DTSearchWay");
            ddl.SetSelectItem((int)md.HisDTSearchWay);
            this.Pub2.Add(ddl);

            this.Pub2.Add("&nbsp;字段:");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_DTSearchKey";
            foreach (MapAttr mattr in attrsOfSearch)
            {
                if (mattr.MyDataType == DataType.AppDate || mattr.MyDataType == DataType.AppDateTime)
                {
                    if (mattr.UIVisible == false)
                    {
                        continue;
                    }
                    ddl.Items.Add(new ListItem(mattr.KeyOfEn + "  " + mattr.Name, mattr.KeyOfEn));
                }
            }
            ddl.SetSelectItem(md.DTSearchKey);
            this.Pub2.Add(ddl);
            this.Pub2.AddFieldSetEnd();
        }

        this.Pub2.AddHR();
        Button btn = new Button();
        btn.Text     = "保存";
        btn.ID       = "Btn_Save";
        btn.CssClass = "Btn";
        btn.Click   += new EventHandler(btn_SearchCond_Click);
        this.Pub2.Add(btn);
        #endregion
    }
Example #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FindWorkerRole en = new FindWorkerRole();

            en.OID = this.RefOID;
            if (en.OID != 0)
            {
                en.Retrieve();
            }

            if (this.RefOID != 0 && this.S1 == null)
            {
                if (en.SortVal1 != "0")
                {
                    this.Response.Redirect("Leader.aspx?S1=" + en.SortVal1 + "&RefOID=" + this.RefOID + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node, true);
                    return;
                }
            }

            #region 1级
            this.UCS1.AddFieldSet("人员范围其它参数");
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID           = "DDL_S1"; // 第一纬度.
            ddl.AutoPostBack = true;
            ddl.Items.Add(new ListItem("当前提交人", "0"));
            ddl.Items.Add(new ListItem("指定节点的提交人", "1"));
            ddl.Items.Add(new ListItem("按表单字段指定的提交人", "2"));
            if (this.S1 != null)
            {
                ddl.SetSelectItem(this.S1);
            }
            else
            {
                ddl.SetSelectItem(en.SortVal1);
            }

            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.UCS1.Add("选择人员");
            this.UCS1.Add(ddl);
            #endregion 2级

            #region 2级
            if (this.S1 == "1")
            {
                this.UCS2.AddFieldSet("您需要指定一个节点.");
                this.UCS2.Add("选择节点");
                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_V1"; // 第一个纬度的参数.
                ddl.BindSQL("SELECT NodeID AS No, Name FROM WF_Node WHERE FK_Flow='" + this.FK_Flow + "' ORDER BY NODEID ",
                            "No", "Name", "20");
                this.UCS2.Add(ddl);
                ddl.SetSelectItem(en.TagVal1); // 第一纬度的参数.
                this.UCS2.AddFieldSetEnd();
            }

            if (this.S1 == "2")
            {
                this.UCS2.AddFieldSet("选择表单字段");
                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_V1";  //第一个纬度的参数
                ddl.BindSQL("SELECT KeyOfEn as No, KeyOfEn+' - '+Name as Name FROM Sys_MapAttr WHERE FK_MapData='ND" + int.Parse(this.FK_Flow) + "Rpt' AND MyDataType=1 ",
                            "No", "Name", "20");

                this.UCS2.Add("选择一个字段");
                this.UCS2.Add(ddl);
                ddl.SetSelectItem(en.TagVal1); // 第一纬度的参数.
                this.UCS2.AddFieldSetEnd();
            }
            #endregion 2级

            #region 绑定后半部分.
            this.UCS3.AddFieldSet("人员范围其它参数");
            // 其他的配置信息.
            BP.Web.Controls.RadioBtn rb = new BP.Web.Controls.RadioBtn();
            rb.GroupName = "s";
            rb.ID        = "RB_0";
            rb.Text      = "直接主管";
            if (en.SortVal2 == "0")
            {
                rb.Checked = true;
            }

            this.UCS3.Add(rb);
            this.UCS3.AddHR();

            //特定职务级别的主管
            rb           = new BP.Web.Controls.RadioBtn();
            rb.GroupName = "s";
            rb.ID        = "RB_1";
            rb.Text      = "特定职务级别的主管";
            if (en.SortVal2 == "1")
            {
                rb.Checked = true;
            }

            this.UCS3.Add(rb);
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_DutyLevel";
            ddl.BindSQL("SELECT distinct DutyLevel AS No, DutyLevel as Name FROM Port_DeptEmp WHERE DutyLevel IS NOT NULL",
                        "No", "Name", "20");
            this.UCS3.Add(ddl);
            ddl.SetSelectItem(en.TagVal2);
            this.UCS3.AddHR();

            // 特定职务的领导
            rb           = new BP.Web.Controls.RadioBtn();
            rb.GroupName = "s";
            rb.ID        = "RB_2";
            rb.Text      = "特定职务的领导";

            if (en.SortVal2 == "2")
            {
                rb.Checked = true;
            }

            this.UCS3.Add(rb);
            ddl = new BP.Web.Controls.DDL();
            ddl.BindSQL("SELECT No, Name FROM Port_Duty ", "No", "Name", "20");
            ddl.SetSelectItem(en.TagVal2);
            ddl.ID = "DDL_Duty";

            this.UCS3.Add(ddl);
            this.UCS3.AddHR();

            // 特定岗位
            rb           = new BP.Web.Controls.RadioBtn();
            rb.GroupName = "s";
            rb.ID        = "RB_3";
            rb.Text      = "特定岗位";
            this.UCS3.Add(rb);
            if (en.SortVal2 == "3")
            {
                rb.Checked = true;
            }
            ddl = new BP.Web.Controls.DDL();
            ddl.BindSQL("SELECT No, Name FROM Port_Station ", "No", "Name", "20");
            ddl.SetSelectItem(en.TagVal2);
            ddl.ID = "DDL_Station";
            this.UCS3.Add(ddl);
            this.UCS3.AddFieldSetEnd();
            #endregion 绑定后半部分.

            Button btn = new Button();
            btn.ID     = "Btn_Save";
            btn.Text   = " Save ";
            btn.Click += new EventHandler(btn_Click);
            this.UCS3.Add(btn);
        }
Example #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.UCSys1.AddTable();
        this.UCSys1.AddCaptionLeft("站点全局信息配置:(您也可以打开web.config中直接修改它)");
        this.UCSys1.AddTR();
        this.UCSys1.AddTDTitle("IDX");
        this.UCSys1.AddTDTitle("项目Key");
        this.UCSys1.AddTDTitle("名称");
        this.UCSys1.AddTDTitle("值");
        this.UCSys1.AddTDTitle("描述");
        this.UCSys1.AddTREnd();

        // BP.Web.WebUser.Style

        WebConfigDescs ens = new WebConfigDescs();

        ens.RetrieveAll();
        Configuration      cfg        = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
        AppSettingsSection appSetting = cfg.AppSettings;
        bool is1 = false;
        int  i   = 1;

        foreach (System.Configuration.KeyValueConfigurationElement mycfg in appSetting.Settings)
        {
            WebConfigDesc en = ens.GetEnByKey("No", mycfg.Key) as WebConfigDesc;
            if (en == null)
            {
                en    = new WebConfigDesc();
                en.No = mycfg.Key;
            }

            is1 = this.UCSys1.AddTR(is1);
            this.UCSys1.AddTDIdx(i++);
            this.UCSys1.AddTD(en.No);
            this.UCSys1.AddTD(en.Name);
            switch (en.DBType)
            {
            case "Boolen":

                RadioButton rb1 = new RadioButton();
                rb1.Text      = "是";
                rb1.GroupName = en.No;
                rb1.ID        = "rb1" + en.No;
                rb1.Enabled   = en.IsEnable;

                RadioButton rb0 = new RadioButton();
                rb0.Text      = "否";
                rb0.GroupName = en.No;
                rb0.ID        = "rb0" + en.No;
                rb0.Enabled   = en.IsEnable;


                if (System.Web.Configuration.WebConfigurationManager.AppSettings[en.No] == "1")
                {
                    rb1.Checked = true;
                }
                else
                {
                    rb0.Checked = true;
                }


                this.UCSys1.AddTDBegin();
                this.UCSys1.Add(rb1);
                this.UCSys1.Add(rb0);
                this.UCSys1.AddTDEnd();
                break;

            case "Enum":
                BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                ddl.ID      = "DDL_" + en.No;
                ddl.Enabled = en.IsEnable;

                BP.Sys.SysEnums ses = new BP.Sys.SysEnums(en.No, en.Vals);
                ddl.BindSysEnum(en.No, int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings[en.No]));
                this.UCSys1.AddTD(ddl);
                break;

            case "String":
            default:
                TextBox tb = new TextBox();
                tb.ID      = "TB_" + en.No;
                tb.Text    = System.Web.Configuration.WebConfigurationManager.AppSettings[en.No];
                tb.Columns = 80;
                tb.Enabled = en.IsEnable;
                this.UCSys1.AddTD(tb);
                break;
            }
            this.UCSys1.AddTD(en.Note);
            //    this.UCSys1.AddTDBigDoc(en.Note);

            this.UCSys1.AddTREnd();
        }
        this.UCSys1.AddTRSum();
        this.UCSys1.AddTD();
        this.UCSys1.AddTD();
        this.UCSys1.AddTD();

        Button btn = new Button();

        btn.ID       = "Btn_Save";
        btn.Text     = " 保存全局设置 ";
        btn.CssClass = "Btn";

        this.UCSys1.AddTD(btn);
        btn.Click += new EventHandler(btn_Click);
        this.UCSys1.AddTD();
        this.UCSys1.AddTREnd();
        this.UCSys1.AddTableEnd();
    }
Example #25
0
    public void BindAdv()
    {
        this.UCSys1.AddTable("width=100%");

        this.UCSys1.AddCaptionLeftTX("<b>基本配置</b> - <a href='?EnsName=" + this.EnsName + "&DoType=SelectCols&T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "'>选择列</a> - <a href='EnsDataIO.aspx?EnsName=" + this.EnsName + "' >数据导入导出</a>");

        this.UCSys1.AddTR();
        this.UCSys1.AddTDTitle("配置项");
        this.UCSys1.AddTDTitle("内容");
        this.UCSys1.AddTDTitle("信息");
        this.UCSys1.AddTREnd();

        Entity   en1   = BP.En.ClassFactory.GetEns(this.EnsName).GetNewEntity;
        Attrs    attrs = en1.EnMap.HisCfgAttrs;
        UIConfig cfg   = new UIConfig(en1);
        bool     is1   = false;

        foreach (Attr attr in attrs)
        {
            if (attr.IsRefAttr)
            {
                continue;
            }

            if (attr.UIVisible == false)    //added by liuxc,2015-8-7
            {
                continue;
            }

            is1 = this.UCSys1.AddTR(is1);
            this.UCSys1.AddTD(attr.Key);
            this.UCSys1.AddTD(attr.Desc);
            switch (attr.UIContralType)
            {
            case UIContralType.DDL:
                BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_" + attr.Key;

                SysEnums ses = new SysEnums(attr.Key, attr.UITag);
                ddl.BindSysEnum(attr.Key);

                if (string.IsNullOrEmpty(cfg.HisAP.GetValStrByKey(attr.Key)))
                {
                    ddl.SetSelectItem(attr.DefaultVal.ToString());
                }
                else
                {
                    ddl.SetSelectItem(cfg.HisAP.GetValIntByKey(attr.Key));
                }

                this.UCSys1.AddTD(ddl);
                break;

            case UIContralType.CheckBok:
                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + attr.Key;
                cb.Text = attr.Desc;
                if (string.IsNullOrEmpty(cfg.HisAP.GetValStrByKey(attr.Key)))
                {
                    if (attr.DefaultVal.ToString() == "0")
                    {
                        cb.Checked = false;
                    }
                    else
                    {
                        cb.Checked = true;
                    }
                }
                else
                {
                    cb.Checked = cfg.HisAP.GetValBoolenByKey(attr.Key);    // en.CfgValOfBoolen;
                }
                this.UCSys1.AddTD(cb);
                break;

            default:
                TextBox tb = new TextBox();
                tb.ID = "TB_" + attr.Key;
                if (cfg.HisAP.GetValStrByKey(attr.Key) == null)
                {
                    tb.Text = attr.DefaultVal.ToString();
                }
                else
                {
                    tb.Text = cfg.HisAP.GetValStrByKey(attr.Key);
                }
                tb.Attributes["width"] = "100%";
                this.UCSys1.AddTD(tb);
                break;
            }
            this.UCSys1.AddTREnd();
        }

        this.UCSys1.AddTableEnd();
        Button btn = new Button();

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

        btn          = new Button();
        btn.ID       = "Btn_SaveAndClose";
        btn.CssClass = "Btn";

        btn.Text   = "保存并关闭";
        btn.Click += new EventHandler(btn_Click);
        this.UCSys1.Add(btn);
    }
Example #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "表单事件";
            FrmEventXmls xmls = new FrmEventXmls();

            xmls.RetrieveAll();

            FrmEventXml curr = null;

            this.Pub1.Add("<a href='http://ccflow.org' target=_blank ><img src='/DataUser/ICON/" + SystemConfig.CompanyID + "/LogBiger.png' border=0 width='120px;' /></a><hr>");
            this.Pub1.AddUL();
            foreach (FrmEventXml xml in xmls)
            {
                if (xml.No == this.DoType)
                {
                    curr = xml;
                    this.Pub1.AddLi("<a href='FrmEvent.aspx?DoType=" + xml.No + "&FK_MapData=" + this.FK_MapData + "' ><b>" + xml.Name + "</b></a>");
                }
                else
                {
                    this.Pub1.AddLi("<a href='FrmEvent.aspx?DoType=" + xml.No + "&FK_MapData=" + this.FK_MapData + "' >" + xml.Name + "</a>");
                }
            }
            this.Pub1.AddULEnd();

            if (this.DoType == null)
            {
                this.Pub2.AddFieldSet("Help");
                this.Pub2.AddH2("什么是表单事件?");
                this.Pub2.AddH2("如何使用表单事件?");
                this.Pub2.Add("请参考操作手册, http://ccflow.org .");
                this.Pub2.AddFieldSetEnd();
                return;
            }

            FrmEvent fe = new FrmEvent(this.FK_MapData, this.DoType);

            this.Pub2.AddTable("width=100%");
            this.Pub2.AddCaptionLeft("表单事件:" + curr.Name);
            this.Pub2.AddTR();
            this.Pub2.AddTD("事件类型");
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + FrmEventAttr.FK_Event;
            ddl.BindSysEnum("EventDoType", (int)fe.HisDoType);
            this.Pub2.AddTD(ddl);
            this.Pub2.AddTREnd();

            this.Pub2.AddTR();
            this.Pub2.AddTDBegin("colspan=2");
            this.Pub2.Add("执行内容<br>");
            BP.Web.Controls.TB tb = new BP.Web.Controls.TB();
            tb.ID       = "TB_" + FrmEventAttr.DoDoc;
            tb.Text     = fe.DoDoc;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Columns  = 60;
            tb.Rows     = 5;
            this.Pub2.Add(tb);
            this.Pub2.AddTDEnd();
            this.Pub2.AddTREnd();

            this.Pub2.AddTR();
            this.Pub2.AddTDBegin("colspan=2");
            this.Pub2.Add("执行成功提示<br>");
            tb          = new BP.Web.Controls.TB();
            tb.ID       = "TB_" + FrmEventAttr.MsgOK;
            tb.Text     = fe.MsgOKString;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Columns  = 60;
            tb.Rows     = 5;
            this.Pub2.Add(tb);
            this.Pub2.AddTDEnd();
            this.Pub2.AddTREnd();

            this.Pub2.AddTR();
            this.Pub2.AddTDBegin("colspan=2");
            this.Pub2.Add("执行错误提示<br>");
            tb          = new BP.Web.Controls.TB();
            tb.ID       = "TB_" + FrmEventAttr.MsgError;
            tb.Text     = fe.MsgErrorString;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Columns  = 60;
            tb.Rows     = 5;
            this.Pub2.Add(tb);
            this.Pub2.AddTDEnd();
            this.Pub2.AddTREnd();
            this.Pub2.AddTableEndWithHR();

            Button btn = new Button();

            btn.Click   += new EventHandler(btn_Click);
            btn.Text     = " Save ";
            btn.CssClass = "Btn";
            this.Pub2.Add(btn);
        }
Example #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Pub1.AddTable();
            this.Pub1.AddCaption("演示使用BP的用户控件来呈现与采集数据.");

            this.Pub1.AddTR();
            this.Pub1.AddTD("帐号");
            BP.Web.Controls.TB tb = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.No;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("不能为空,字母或者下划线组合.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("密码");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Pass;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("重输密码");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_Pass1";
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("两次密码不能重复.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("姓名");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Name;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("不能为空");
            this.Pub1.AddTREnd();

            //枚举类型.
            this.Pub1.AddTR();
            this.Pub1.AddTD("性别");
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.BindSysEnum("XB"); // 在Sys_Eumm 已经注册了该枚举值.
            ddl.ID = "TB_" + BPUserAttr.XB;
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("请选择");
            this.Pub1.AddTREnd();


            // 数值类型.
            this.Pub1.AddTR();
            this.Pub1.AddTD("年龄");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Age;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("输入int类型数据.");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTD("地址");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Addr;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("电话");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Tel;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("邮件");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Email;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            Button btn = new Button();

            btn.ID     = "Btn_Reg";
            btn.Text   = "注册新用户";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.AddTD("colspan=3", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Example #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.DoType == "Del")
            {
                FrmAttachmentDB delDB = new FrmAttachmentDB();
                delDB.MyPK = this.DelPKVal;
                delDB.DirectDelete();
            }

            if (this.DoType == "Down")
            {
                FrmAttachmentDB downDB = new FrmAttachmentDB();
                downDB.MyPK = this.MyPK;
                downDB.Retrieve();
                BP.PubClass.DownloadFile(downDB.FileFullName, downDB.FileName);
                this.WinClose();
                return;
            }

            BP.Sys.FrmAttachment athDesc = new BP.Sys.FrmAttachment();
            athDesc.MyPK = this.FK_FrmAttachment;
            if (athDesc.RetrieveFromDBSources() == 0)
            {
            }

            this.Title = athDesc.Name;

            this.Pub1.AddTable("width='100%'");
            if (this.IsBTitle == "1")
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDTitle("IDX");
                if (athDesc.Sort.Contains(","))
                {
                    this.Pub1.AddTDTitle("类别");
                }
                this.Pub1.AddTDTitle("文件名");
                this.Pub1.AddTDTitle("大小KB");
                this.Pub1.AddTDTitle("上传日期");
                this.Pub1.AddTDTitle("上传人");
                if (athDesc.IsNote)
                {
                    this.Pub1.AddTDTitle("备注");
                }
                this.Pub1.AddTDTitle("操作");
                this.Pub1.AddTREnd();
            }
            else
            {
                this.Pub1.AddTR();
                this.Pub1.AddTD("IDX");
                if (athDesc.Sort.Contains(","))
                {
                    this.Pub1.AddTD("类别");
                }
                this.Pub1.AddTD("文件名");
                this.Pub1.AddTD("大小KB");
                this.Pub1.AddTD("上传日期");
                this.Pub1.AddTD("上传人");
                if (athDesc.IsNote)
                {
                    this.Pub1.AddTD("备注");
                }
                this.Pub1.AddTD("操作");
                this.Pub1.AddTREnd();
            }

            BP.Sys.FrmAttachmentDBs dbs = new BP.Sys.FrmAttachmentDBs();
            dbs.Retrieve(FrmAttachmentDBAttr.FK_FrmAttachment, this.FK_FrmAttachment,
                         FrmAttachmentDBAttr.RefPKVal, this.PKVal);
            int i = 0;

            foreach (FrmAttachmentDB db in dbs)
            {
                i++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(i);
                if (athDesc.Sort.Contains(","))
                {
                    this.Pub1.AddTD(db.Sort);
                }

                // this.Pub1.AddTDIdx(i++);
                if (athDesc.IsDownload)
                {
                    this.Pub1.AddTD("<a href='AttachmentUpload.aspx?DoType=Down&MyPK=" + db.MyPK + "' target=_blank ><img src='/WF/Img/FileType/" + db.FileExts + ".gif' border=0 onerror=\"src='/WF/Img/FileType/Undefined.gif'\" />" + db.FileName + "</a>");
                }
                else
                {
                    this.Pub1.AddTD(db.FileName);
                }

                this.Pub1.AddTD(db.FileSize);
                this.Pub1.AddTD(db.RDT);
                this.Pub1.AddTD(db.RecName);
                if (athDesc.IsNote)
                {
                    this.Pub1.AddTD(db.MyNote);
                }

                if (athDesc.IsDelete && this.IsReadonly != "1")
                {
                    this.Pub1.AddTD("<a href=\"javascript:Del('" + this.FK_FrmAttachment + "','" + this.PKVal + "','" + db.MyPK + "')\">删除</a>");
                }
                else
                {
                    this.Pub1.AddTD("");
                }
                this.Pub1.AddTREnd();
            }
            if (athDesc.IsUpload && this.IsReadonly != "1")
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDBegin("colspan=7");
                this.Pub1.Add("文件:");
                System.Web.UI.WebControls.FileUpload fu = new System.Web.UI.WebControls.FileUpload();
                fu.ID          = "file";
                fu.BorderStyle = BorderStyle.NotSet;
                this.Pub1.Add(fu);
                if (athDesc.Sort.Contains(","))
                {
                    string[]            strs = athDesc.Sort.Split(',');
                    BP.Web.Controls.DDL ddl  = new BP.Web.Controls.DDL();
                    ddl.ID = "ddl";
                    foreach (string str in strs)
                    {
                        if (str == null || str == "")
                        {
                            continue;
                        }
                        ddl.Items.Add(new ListItem(str, str));
                    }
                    this.Pub1.Add(ddl);
                }

                if (athDesc.IsNote)
                {
                    TextBox tb = new TextBox();
                    tb.ID = "TB_Note";
                    tb.Attributes["Width"] = "100%";
                    tb.Attributes["class"] = "TBNote";
                    tb.Columns             = 30;
                    this.Pub1.Add("&nbsp;备注:");
                    this.Pub1.Add(tb);
                }
                Button btn = new Button();
                btn.Text     = "上传";
                btn.ID       = "Btn_Upload";
                btn.CssClass = "Btn";
                btn.Click   += new EventHandler(btn_Click);
                this.Pub1.Add(btn);
                this.Pub1.AddTDEnd();
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
Example #29
0
        /// <summary>
        /// 执行数据的保存操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                string   rpt   = "ND" + int.Parse(this.FK_Flow) + "Rpt";
                Flow     fl    = new Flow(this.FK_Flow);
                MapAttrs attrs = new MapAttrs(rpt);

                #region 求业务表的主键。
                string pk = this.Pub1.GetDDLByID("DDL_OID").SelectedItemStringVal;
                if (string.IsNullOrEmpty(pk) == true)
                {
                    BP.Sys.PubClass.Alert("@必须设置业务表的主键,否则无法同步。");
                    return;
                }
                #endregion 求业务表的主键。

                string lcStr = ""; //要同步的流程字段
                string ywStr = ""; //第三方字段
                string err   = "";
                foreach (MapAttr attr in attrs)
                {
                    CheckBox cb = this.Pub1.GetCBByID("CB_" + attr.KeyOfEn);
                    if (cb == null || cb.Checked == false)
                    {
                        continue;
                    }

                    BP.Web.Controls.DDL ddl = this.Pub1.GetDDLByID("DDL_" + attr.KeyOfEn);


                    //如果选中的业务字段重复,抛出异常
                    if (ywStr.Contains("@" + ddl.SelectedItemStringVal + "@"))
                    {
                        err += "@配置【" + attr.KeyOfEn + " - " + attr.Name +
                               "】错误, 请确保选中业务字段的唯一性,该业务字段已经被其他字段所使用。";
                    }
                    lcStr += "@" + attr.KeyOfEn + "@,";
                    ywStr += "@" + ddl.SelectedItemStringVal + "@,";
                }

                BP.Web.Controls.RadioBtn rb = this.Pub1.GetRadioBtnByID("rb_workId");

                BP.Web.Controls.DDL ddl_key = this.Pub1.GetDDLByID("DDL_OID");
                if (rb.Checked)
                {
                    if (ywStr.Contains("@" + ddl_key.SelectedItemStringVal + "@"))
                    {
                        err += "@请确保选中业务字段的唯一性,该业务字段【" + ddl_key.SelectedItemStringVal +
                               "】已经被其他字段所使用。";
                    }
                    lcStr = "@OID@," + lcStr;
                    ywStr = "@" + ddl_key.SelectedItemStringVal + "@," + ywStr;
                }
                else
                {
                    if (ywStr.Contains("@" + ddl_key.SelectedItemStringVal + "@"))
                    {
                        err += "@请确保选中业务字段的唯一性,该业务字段【" + ddl_key.SelectedItemStringVal +
                               "】已经被其他字段所使用。";
                    }
                    lcStr = "@GUID@," + lcStr;
                    ywStr = "@" + ddl_key.SelectedItemStringVal + "@," + ywStr;
                }

                if (err != "")
                {
                    BP.Sys.PubClass.Alert(err);
                    return;
                }

                lcStr = lcStr.Replace("@", "");
                ywStr = ywStr.Replace("@", "");


                //去除最后一个字符的操作
                if (string.IsNullOrEmpty(lcStr) || string.IsNullOrEmpty(ywStr))
                {
                    BP.Sys.PubClass.Alert("要配置的内容为空...");
                    return;
                }
                lcStr = lcStr.Substring(0, lcStr.Length - 1);
                ywStr = ywStr.Substring(0, ywStr.Length - 1);


                //数据存储格式   a,b,c@a_1,b_1,c_1
                fl.DTSFields   = lcStr + "@" + ywStr;
                fl.DTSBTablePK = pk;
                fl.Update();

                // System.Web.HttpContext.Current.Response.Write("<script language='JavaScript'>if (confirm('操作成功,是否关闭配置页面?'))" +
                //"{window.parent.closeTab('设置字段匹配');}</script> ");

                System.Web.HttpContext.Current.Response.Write("<script language='JavaScript'>if (confirm('操作成功,是否关闭配置页面?'))" +
                                                              "{try{window.parent.closeTab('设置字段匹配');}catch{}}</script> ");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }