Example #1
0
        void btn_Click(object sender, EventArgs e)
        {
            FrmField sln = new FrmField();

            sln.Retrieve(FrmFieldAttr.FK_MapData, this.FK_MapData,
                         FrmFieldAttr.KeyOfEn, this.KeyOfEn,
                         FrmFieldAttr.FK_Node, this.FK_Node);

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

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

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

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

            sln.MyPK = this.FK_MapData + "_" + this.FK_Flow + "_" + this.FK_Node + "_" + this.KeyOfEn;
            sln.CheckPhysicsTable();
            sln.Save();
            this.WinClose();
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.DoType)
            {
            case "DelSln":     //删除sln.
                FrmField sln = new FrmField();
                sln.Delete(FrmFieldAttr.FK_MapData, this.FK_MapData,
                           FrmFieldAttr.KeyOfEn, this.KeyOfEn,
                           FrmFieldAttr.FK_Flow, this.FK_Flow,
                           FrmFieldAttr.FK_Node, this.FK_Node);
                this.WinClose();
                return;

            case "EditSln":     //编辑sln.
                this.EditSln();
                return;

            case "Copy":     //编辑sln.
                this.Copy();
                return;

            case "CopyIt":     //编辑sln.
                BP.WF.Glo.CopyFrmSlnFromNodeToNode(this.FK_Flow, this.FK_MapData,
                                                   int.Parse(this.FK_Node),
                                                   int.Parse(this.Request.QueryString["FromSln"]));

                this.WinClose();
                return;

            default:
                break;
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 功能执行.
            if (this.DoType == "DeleteFJ")
            {
                FrmAttachment ath1 = new FrmAttachment();
                ath1.MyPK = this.FK_MapData + "_" + this.Ath + "_" + this.FK_Node;
                ath1.Delete();
                this.WinClose();
                return;
            }

            if (this.DoType == "DeleteDtl")
            {
                MapDtl dtl = new MapDtl();
                dtl.No = this.FK_MapDtl + "_" + this.FK_Node;
                dtl.Delete();
                this.WinClose();
                return;
            }
            #endregion 功能执行.

            MapData  md  = new MapData(this.FK_MapData);
            FrmField sln = new FrmField();
            sln.CheckPhysicsTable();

            switch (this.DoType)
            {
            case "Dtl":     //附件方案.
                this.Title = "从表权限";
                BindDtl();
                break;

            case "FJ":     //附件方案.
                this.Title = "表单附件权限";
                BindFJ();
                break;

            case "Field":     //字段方案.
                this.Title = "表单字段权限";
                this.BindSln();
                break;

            case "Copy":     //字段方案.
                this.Title = "从其它节点复制权限";
                this.BindCopy();
                break;

            case "DoCopy":     //字段方案.
                this.Title = "执行复制权限方案";
                this.DoCopy();
                break;

            default:
                this.Title = "没有涉及到的类型:" + this.DoType;
                break;
            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.DoType)
            {
            case "DelSln":     //删除sln.
                FrmField sln = new FrmField();
                sln.Delete(FrmFieldAttr.FK_MapData, this.FK_MapData,
                           FrmFieldAttr.KeyOfEn, this.KeyOfEn,
                           FrmFieldAttr.FK_Flow, this.FK_Flow,
                           FrmFieldAttr.FK_Node, this.FK_Node);
                this.WinClose();
                return;

            case "EditSln":     //编辑sln.
                this.EditSln();
                return;

            case "Copy":     //编辑sln.
                this.Copy();
                return;

            case "CopyIt":     //编辑sln.
                FrmFields fss = new FrmFields();
                fss.Delete(FrmFieldAttr.FK_MapData, this.FK_MapData,
                           FrmFieldAttr.FK_Flow, this.FK_Flow,
                           FrmFieldAttr.FK_Node, this.FK_Node);

                fss = new FrmFields(this.FK_MapData, int.Parse(this.Request.QueryString["FromSln"]));
                //fss.Retrieve(FrmFieldAttr.FK_MapData, this.FK_MapData,
                //    FrmFieldAttr.FK_Node, this.Request.QueryString["FromSln"]);

                foreach (FrmField sl in fss)
                {
                    sl.FK_Node = int.Parse(this.FK_Node);
                    sl.FK_Flow = this.FK_Flow;
                    sl.MyPK    = this.FK_MapData + "_" + this.FK_Flow + "_" + this.FK_Node + "_" + sl.KeyOfEn;
                    sl.Insert();
                }
                this.WinClose();
                return;

            default:
                break;
            }
        }
Example #5
0
        public string Fields_Save()
        {
            Node currND = new Node(this.FK_Node);

            string FieldsAttrsObj = this.GetRequestVal("FieldsAttrsObj");
            var    jsonSetting    = new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            };
            List <FieldsAttrs> fieldsAttrsList = JsonConvert.DeserializeObject <List <FieldsAttrs> >(FieldsAttrsObj, jsonSetting);

            if (fieldsAttrsList == null)
            {
                return("0");
            }

            MapAttrs attrs = new MapAttrs();
            //增加排序
            QueryObject obj = new QueryObject(attrs);

            obj.AddWhere(MapAttrAttr.FK_MapData, this.FK_MapData);
            obj.DoQuery();

            foreach (MapAttr attr in attrs)
            {
                foreach (FieldsAttrs fieldsAttrs in fieldsAttrsList)
                {
                    if (!attr.KeyOfEn.Equals(fieldsAttrs.KeyOfEn))
                    {
                        continue;
                    }

                    if (currND.HisFormType == NodeFormType.RefOneFrmTree)
                    {
                        attr.UIVisible  = fieldsAttrs.UIVisible;
                        attr.UIIsEnable = fieldsAttrs.UIIsEnable;
                        attr.IsSigan    = fieldsAttrs.IsSigan;
                        attr.DefVal     = fieldsAttrs.DefVal;
                        attr.UIIsInput  = fieldsAttrs.IsNotNull;
                        attr.FK_MapData = this.FK_MapData;
                        attr.KeyOfEn    = attr.KeyOfEn;
                        attr.Name       = attr.Name;
                        attr.Update();

                        //如果是表单库表单,需要写入MapAttr
                        if (DataType.IsNullOrEmpty(fieldsAttrs.RegularExp) == false)
                        {
                            MapExt ext       = new MapExt();
                            bool   extisExit = ext.IsExit("MyPK", "RegularExpression_" + this.FK_MapData + "_" + fieldsAttrs.KeyOfEn + "_onchange");

                            ext.FK_MapData = this.FK_MapData;
                            ext.ExtType    = MapExtXmlList.RegularExpression;
                            ext.DoWay      = 0;
                            ext.AttrOfOper = fieldsAttrs.KeyOfEn;
                            ext.Doc        = fieldsAttrs.RegularExp;
                            ext.Tag        = "onchange";
                            ext.Tag1       = "格式不正确!";

                            if (extisExit)
                            {
                                ext.Update();
                            }
                            else
                            {
                                ext.MyPK = "RegularExpression_" + this.FK_MapData + "_" + fieldsAttrs.KeyOfEn + "_onchange";
                                ext.Insert();
                            }
                        }
                    }

                    FrmField frmField = new FrmField();
                    bool     isExit   = frmField.IsExit("MyPK",
                                                        this.FK_MapData + "_" + this.FK_Flow + "_" + this.FK_Node + "_" + fieldsAttrs.KeyOfEn + "_" + FrmEleType.Field);

                    frmField.UIVisible          = fieldsAttrs.UIVisible;
                    frmField.UIIsEnable         = fieldsAttrs.UIIsEnable;
                    frmField.IsSigan            = fieldsAttrs.IsSigan;
                    frmField.DefVal             = fieldsAttrs.DefVal;
                    frmField.IsNotNull          = fieldsAttrs.IsNotNull;
                    frmField.RegularExp         = fieldsAttrs.RegularExp;
                    frmField.IsWriteToFlowTable = fieldsAttrs.IsWriteToFlowTable;
                    //frmField.IsWriteToGenerWorkFlow = fieldsAttrs.IsWriteToGenerWorkFlow;  //sln无此属性
                    frmField.FK_Node    = this.FK_Node;
                    frmField.FK_Flow    = this.FK_Flow;
                    frmField.FK_MapData = this.FK_MapData;
                    frmField.KeyOfEn    = attr.KeyOfEn;
                    frmField.Name       = attr.Name;

                    if (isExit)
                    {
                        frmField.Update();
                    }
                    else
                    {
                        frmField.Insert();
                    }
                }
            }

            return(fieldsAttrsList.Count.ToString());
        }
Example #6
0
        public string Fields_Init()
        {
            FrmFields fss = new FrmFields(this.FK_MapData, this.FK_Node);

            MapAttrs    attrs = new MapAttrs();
            QueryObject obj   = new QueryObject(attrs);

            obj.AddWhere(MapAttrAttr.FK_MapData, this.FK_MapData);
            obj.addOrderBy(MapAttrAttr.Y, MapAttrAttr.X);
            obj.DoQuery();

            List <FieldsAttrs> fieldsAttrsList = new List <FieldsAttrs>();
            int idx = 0;

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

                default:
                    break;
                }

                fieldsAttrsList.Add(new FieldsAttrs {
                });
                fieldsAttrsList[idx].idx     = idx;
                fieldsAttrsList[idx].KeyOfEn = attr.KeyOfEn;
                fieldsAttrsList[idx].Name    = attr.Name;
                fieldsAttrsList[idx].LGTypeT = attr.LGTypeT;

                FrmField sln = fss.GetEntityByKey(FrmFieldAttr.KeyOfEn, attr.KeyOfEn) as FrmField;
                if (sln == null)
                {
                    fieldsAttrsList[idx].UIVisible              = false;
                    fieldsAttrsList[idx].UIIsEnable             = false;
                    fieldsAttrsList[idx].IsSigan                = false;
                    fieldsAttrsList[idx].DefVal                 = "";
                    fieldsAttrsList[idx].IsNotNull              = false;
                    fieldsAttrsList[idx].IsSigan                = false;
                    fieldsAttrsList[idx].RegularExp             = "";
                    fieldsAttrsList[idx].IsWriteToFlowTable     = false;
                    fieldsAttrsList[idx].IsWriteToGenerWorkFlow = false;
                }
                else
                {
                    fieldsAttrsList[idx].UIVisible          = sln.UIVisible;
                    fieldsAttrsList[idx].UIIsEnable         = sln.UIIsEnable;
                    fieldsAttrsList[idx].IsSigan            = sln.IsSigan;
                    fieldsAttrsList[idx].DefVal             = sln.DefVal;
                    fieldsAttrsList[idx].IsNotNull          = sln.IsNotNull;
                    fieldsAttrsList[idx].IsSigan            = sln.IsSigan;
                    fieldsAttrsList[idx].RegularExp         = sln.RegularExp;
                    fieldsAttrsList[idx].IsWriteToFlowTable = sln.IsWriteToFlowTable;
                    //fieldsAttrsList[idx].IsWriteToGenerWorkFlow = sln.IsWriteToGenerWorkFlow;
                }

                idx++;
            }

            return(LitJson.JsonMapper.ToJson(fieldsAttrsList));
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region  属性
            string sealName = null;
            #endregion 属性

#warning 没有缓存经常预览与设计不一致

            MapData md = new MapData();
            md.No = this.FK_MapData;
            if (this.Request.QueryString["IsTest"] == "1")
            {
                md.RepairMap();
                BP.Sys.SystemConfig.DoClearCash_del();
            }

            if (this.Request.QueryString["IsLoadData"] == "1")
            {
                this.UCEn1.IsLoadData = true;
            }

            if (md.RetrieveFromDBSources() == 0 && md.Name.Length > 3)
            {
                /*如果没有找到,就可能是 dtl 。*/
                if (md.HisFrmType == FrmType.Url || md.HisFrmType == FrmType.SLFrm)
                {
                    string no       = Request.QueryString["NO"];
                    string urlParas = "OID=" + this.OID + "&NO=" + no + "&WorkID=" + this.WorkID + "&FK_Node=" + this.FK_Node + "&UserNo=" + WebUser.No + "&SID=" + this.SID;
                    /*如果是URL.*/
                    if (md.Url.Contains("?") == true)
                    {
                        this.Response.Redirect(md.Url + "&" + urlParas, true);
                    }
                    else
                    {
                        this.Response.Redirect(md.Url + "?" + urlParas, true);
                    }
                    return;
                }

                /* 没有找到此map. */
                MapDtl dtl   = new MapDtl(this.FK_MapData);
                GEDtl  dtlEn = dtl.HisGEDtl;
                dtlEn.SetValByKey("OID", this.FID);

                if (dtlEn.EnMap.Attrs.Count <= 0)
                {
                    md.RepairMap();
                    this.Response.Redirect(this.Request.RawUrl, true);
                    return;
                }

                int i = dtlEn.RetrieveFromDBSources();

                string[] paras = this.RequestParas.Split('&');
                foreach (string str in paras)
                {
                    if (string.IsNullOrEmpty(str) || str.Contains("=") == false)
                    {
                        continue;
                    }

                    string[] kvs = str.Split('=');
                    dtlEn.SetValByKey(kvs[0], kvs[1]);
                }
                Width = md.MaxRight + md.MaxLeft * 2 + 10 + "";
                if (float.Parse(Width) < 500)
                {
                    Width = "900";
                }

                Height = md.MaxEnd > md.FrmH ? md.MaxEnd + "" : md.FrmH + "";
                if (float.Parse(Height) <= 800)
                {
                    Height = "800";
                }

                this.UCEn1.Add("<div id=divCCForm style='width:" + Width + "px;height:" + Height + "px' >");

                if (md.HisFrmType == FrmType.FreeFrm)
                {
                    this.UCEn1.BindCCForm(dtlEn, this.FK_MapData, !this.IsEdit, 0, this.IsLoadData);
                }

                if (md.HisFrmType == FrmType.Column4Frm)
                {
                    this.UCEn1.BindCCForm(dtlEn, this.FK_MapData, !this.IsEdit, 0, this.IsLoadData);
                }

                this.AddJSEvent(dtlEn);
                this.UCEn1.Add("</div>");
            }
            else
            {
                /*如果没有找到,就可能是dtl。*/
                if (md.HisFrmType == FrmType.Url || md.HisFrmType == FrmType.SLFrm)
                {
                    string no       = Request.QueryString["NO"];
                    string urlParas = "OID=" + this.OID + "&NO=" + no + "&WorkID=" + this.WorkID + "&FK_Node=" + this.FK_Node + "&IsEdit=" + this.IsEdit.ToString() + "&UserNo=" + WebUser.No + "&SID=" + this.SID;
                    /*如果是URL.*/
                    if (md.Url.Contains("?") == true)
                    {
                        this.Response.Redirect(md.Url + "&" + urlParas, true);
                    }
                    else
                    {
                        this.Response.Redirect(md.Url + "?" + urlParas, true);
                    }
                    return;
                }

                if (md.HisFrmType == FrmType.WordFrm)
                {
                    string no       = Request.QueryString["NO"];
                    string urlParas = "OID=" + this.OID + "&NO=" + no + "&WorkID=" + this.WorkID + "&FK_Node=" + this.FK_Node + "&UserNo=" + WebUser.No + "&SID=" + this.SID + "&FK_MapData=" + this.FK_MapData + "&OIDPKVal=" + this.OIDPKVal + "&FID=" + this.FID + "&FK_Flow=" + this.FK_Flow;
                    /*如果是URL.*/
                    string   requestParas = this.RequestParas;
                    string[] parasArrary  = this.RequestParas.Split('&');
                    foreach (string str in parasArrary)
                    {
                        if (string.IsNullOrEmpty(str) || str.Contains("=") == false)
                        {
                            continue;
                        }
                        string[] kvs = str.Split('=');
                        if (urlParas.Contains(kvs[0]))
                        {
                            continue;
                        }
                        urlParas += "&" + kvs[0] + "=" + kvs[1];
                    }
                    if (md.Url.Contains("?") == true)
                    {
                        this.Response.Redirect("FrmWord.aspx?1=2" + "&" + urlParas, true);
                    }
                    else
                    {
                        this.Response.Redirect("FrmWord.aspx" + "?" + urlParas, true);
                    }
                    return;
                }

                if (md.HisFrmType == FrmType.ExcelFrm)
                {
                    this.Response.Redirect("FrmExcel.aspx?1=2" + this.RequestParas, true);
                    return;
                }

                GEEntity en = md.HisGEEn;

                #region 求出 who is pk 值.
                int    pk     = this.OID;
                string nodeid = this.FK_Node.ToString();
                if (nodeid != "0" && string.IsNullOrEmpty(this.FK_Flow) == false)
                {
                    /*说明是流程调用它, 就要判断谁是表单的PK.*/
                    FrmNode fn = new FrmNode(this.FK_Flow, this.FK_Node, this.FK_MapData);
                    switch (fn.WhoIsPK)
                    {
                    case WhoIsPK.FID:
                        pk = this.FID;
                        if (pk == 0)
                        {
                            throw new Exception("@没有接收到参数FID");
                        }
                        break;

                    case WhoIsPK.CWorkID:     /*延续流程ID*/
                        pk = this.CWorkID;
                        if (pk == 0)
                        {
                            throw new Exception("@没有接收到参数CWorkID");
                        }
                        break;

                    case WhoIsPK.PWorkID:     /*父流程ID*/
                        pk = this.PWorkID;
                        if (pk == 0)
                        {
                            throw new Exception("@没有接收到参数PWorkID");
                        }
                        break;

                    case WhoIsPK.OID:
                    default:
                        break;
                    }
                }

                en.SetValByKey("OID", pk);
                #endregion 求出pk 值.

                if (en.EnMap.Attrs.Count <= 0)
                {
                    md.RepairMap(); //让他刷新一下,重新进入.
                    this.Response.Redirect(this.Request.RawUrl, true);
                    return;
                }

                //检查实体数据是否存在,并重新设置默认值
                if (en.RetrieveFromDBSources() == 0)
                {
                    en.ResetDefaultValAllAttr();
                    try
                    {
                        en.DirectInsert();
                    }
                    catch (Exception ex)
                    {
                        md.RepairMap();
                        en.CheckPhysicsTable();
                        throw new Exception("@装载出现错误:如果是第一次出现该错误,请刷新一次,系统有可能自动修复了。技术信息:" + ex.Message);
                    }
                }

                string[] paras = this.RequestParas.Split('&');
                foreach (string str in paras)
                {
                    if (string.IsNullOrEmpty(str) || str.Contains("=") == false)
                    {
                        continue;
                    }

                    string[] kvs = str.Split('=');
                    en.SetValByKey(kvs[0], kvs[1]);
                }

                if (en.ToString() == "0")
                {
                    en.SetValByKey("OID", pk);
                }
                this.OIDPKVal = pk;


                #region 处理表单权限控制方案
                Width = md.FrmW.ToString();//md.MaxRight + md.MaxLeft * 2 + 10 + "";
                if (float.Parse(Width) < 500)
                {
                    Width = "900";
                }

                Height = md.MaxEnd > md.FrmH ? md.MaxEnd + "" : md.FrmH + "";
                if (float.Parse(Height) <= 800)
                {
                    Height = "800";
                }

                this.UCEn1.Add("<div id=divCCForm style='width:" + Width + "px;height:" + Height + "px' >");
                if (nodeid != null)
                {
                    this.UCEn1.FK_Node = this.FK_Node;
                    /*处理表单权限控制方案*/
                    this.HisFrmNode = new FrmNode();
                    int ii = this.HisFrmNode.Retrieve(FrmNodeAttr.FK_Frm, this.FK_MapData,
                                                      FrmNodeAttr.FK_Node, int.Parse(nodeid));

                    if (ii == 0 || this.HisFrmNode.FrmSln == 0)
                    {
                        /*说明没有配置,或者方案编号为默认就不用处理,*/
                        this.UCEn1.BindCCForm(en, this.FK_MapData, !this.IsEdit, 0, this.IsLoadData);
                    }
                    else
                    {
                        FrmFields fls = new FrmFields(this.FK_MapData, this.HisFrmNode.FrmSln);
                        //求出集合.
                        MapAttrs mattrs = new MapAttrs(this.FK_MapData);
                        foreach (FrmField item in fls)
                        {
                            foreach (MapAttr attr in mattrs)
                            {
                                if (attr.KeyOfEn != item.KeyOfEn)
                                {
                                    continue;
                                }

                                if (item.IsSigan)
                                {
                                    item.UIIsEnable = false;
                                }
                                if (attr.SignType == SignType.CA)
                                {
                                    long        workId  = Convert.ToInt64(this.OID);
                                    FrmField    keyOfEn = new FrmField();
                                    QueryObject info    = new QueryObject(keyOfEn);
                                    info.AddWhere(FrmFieldAttr.FK_Node, this.FK_Node);
                                    info.addAnd();
                                    info.AddWhere(FrmFieldAttr.FK_MapData, attr.FK_MapData);
                                    info.addAnd();
                                    info.AddWhere(FrmFieldAttr.KeyOfEn, attr.KeyOfEn);
                                    info.addAnd();
                                    info.AddWhere(MapAttrAttr.UIIsEnable, "1");
                                    if (info.DoQuery() > 0)
                                    {
                                        sealName = en.GetValStrByKey(attr.KeyOfEn);
                                    }
                                }

                                attr.UIIsEnable = item.UIIsEnable;
                                attr.UIVisible  = item.UIVisible;
                                attr.IsSigan    = item.IsSigan;
                                attr.DefValReal = item.DefVal;
                            }
                        }

                        #region 设置默认值.
                        if (this.IsEdit == true)
                        {
                            bool isHave = false;
                            foreach (MapAttr attr in mattrs)
                            {
                                //if (attr.UIIsEnable)
                                //    continue;

                                if (attr.DefValReal.Contains("@") == false)
                                {
                                    continue;
                                }

                                en.SetValByKey(attr.KeyOfEn, attr.DefVal);
                                isHave = true;
                            }
                            if (isHave)
                            {
                                en.DirectUpdate(); //让其直接更新.
                            }
                        }
                        #endregion 设置默认值.

                        //按照当前方案绑定表单.

                        /*
                         * 修改说明:如果是自定义方案,就不要装载填充了.
                         */

                        ////是否要重新装载数据.
                        bool isLoadData = this.IsLoadData;
                        if (this.HisFrmNode.IsEnableLoadData == true)
                        {
                            /*如果允许启用.*/
                        }
                        else
                        {
                            isLoadData = false;
                        }

                        this.UCEn1.BindCCForm(en, md, mattrs, this.FK_MapData, !this.IsEdit, Int64.Parse(Width), isLoadData);

                        #region 检查必填项
                        string scriptCheckFrm = "";
                        scriptCheckFrm += "\t\n<script type='text/javascript' >";
                        scriptCheckFrm += "\t\n function CheckFrmSlnIsNull(){ ";
                        scriptCheckFrm += "\t\n var isPass = true;";
                        scriptCheckFrm += "\t\n var alloweSave = true;";
                        scriptCheckFrm += "\t\n var erroMsg = '提示信息:';";

                        //表单权限设置为必填项
                        //查询出来,需要不为空的
                        Paras ps = new Paras();
                        ps.SQL = "SELECT KeyOfEn, Name FROM Sys_FrmSln WHERE FK_MapData=" + ps.DBStr + "FK_MapData AND FK_Node=" + ps.DBStr + "FK_Node AND IsNotNull=" + ps.DBStr + "IsNotNull";
                        ps.Add(FrmFieldAttr.FK_MapData, this.FK_MapData);
                        ps.Add(FrmFieldAttr.FK_Node, this.FK_Node);
                        ps.Add(FrmFieldAttr.IsNotNull, 1);

                        //查询
                        System.Data.DataTable dtKeys = DBAccess.RunSQLReturnTable(ps);
                        // 检查数据是否完整.
                        foreach (System.Data.DataRow dr in dtKeys.Rows)
                        {
                            string             key        = dr[0].ToString();
                            string             name       = dr[1].ToString();
                            BP.Web.Controls.TB TB_NotNull = this.UCEn1.GetTBByID("TB_" + key);
                            if (TB_NotNull != null)
                            {
                                scriptCheckFrm += "\t\n try{  ";
                                scriptCheckFrm += "\t\n var element = document.getElementById('" + TB_NotNull.ClientID + "');";
                                //验证输入的正则格式
                                scriptCheckFrm += "\t\n if(element && element.readOnly == true) return;";
                                scriptCheckFrm += "\t\n isPass = EleSubmitCheck(element,'.{1}','" + name + ",不能为空。');";
                                scriptCheckFrm += "\t\n  if(isPass == false){";
                                scriptCheckFrm += "\t\n    alloweSave = false;";
                                scriptCheckFrm += "\t\n    erroMsg += '" + name + ",不能为空。';";
                                scriptCheckFrm += "\t\n  }";
                                scriptCheckFrm += "\t\n } catch(e) { ";
                                scriptCheckFrm += "\t\n  alert(e.name  + e.message);  return false;";
                                scriptCheckFrm += "\t\n } ";
                            }
                        }
                        scriptCheckFrm += "\t\n return alloweSave; } ";
                        scriptCheckFrm += "\t\n</script>";
                        #endregion
                        //检查必填项
                        this.UCEn1.Add(scriptCheckFrm);
                    }
                }
                else
                {
                    this.UCEn1.BindCCForm(en, this.FK_MapData, !this.IsEdit, 0, this.IsLoadData);
                }
                this.UCEn1.Add("</div>");
                #endregion

                if (!IsPostBack)
                {
                    if (md.IsHaveCA)
                    {
                        #region 检查是否有ca签名.
                        //if (md.IsHaveCA == true)
                        //{
                        //    if (string.IsNullOrEmpty(sealName))
                        //        sealName = WebUser.No;

                        //    string basePath = Server.MapPath("~/DataUser/Siganture/" + WorkID);

                        //    if (!System.IO.Directory.Exists(basePath))
                        //    {
                        //        System.IO.Directory.CreateDirectory(basePath);
                        //    }

                        //    // basePath = "C:\\";

                        //    this.TB_SealFile.Text = basePath + "\\" + sealName + ".jpg";

                        //    #region 获取存储的 签名信息

                        //    BP.Tools.WFSealData sealData = new BP.Tools.WFSealData();
                        //    sealData.RetrieveByAttrAnd(BP.Tools.WFSealDataAttr.OID, WorkID, BP.Tools.WFSealDataAttr.FK_Node, FK_Node);
                        //    //sealData.RetrieveFromDBSources();
                        //    if (!string.IsNullOrEmpty(sealData.SealData))
                        //    {
                        //        this.TB_SealData.Text = sealData.SealData;
                        //    }
                        //    #endregion

                        //    //this.TB_SealData.Text = en.GetValStringByKey("SealData");
                        //}
                        #endregion 检查是否有ca签名.
                    }
                }
                this.AddJSEvent(en);
            }

            Session["Count"]        = null;
            this.Btn_Save.Visible   = this.HisFrmNode.IsEdit;
            this.Btn_Save.Enabled   = this.HisFrmNode.IsEdit;
            this.Btn_Save.BackColor = System.Drawing.Color.White;
            Node curNd = new Node();
            curNd.NodeID = this.FK_Node;
            curNd.RetrieveFromDBSources();

            if (curNd.FormType == NodeFormType.SheetTree)
            {
                this.Btn_Save.Visible  = true;
                this.Btn_Save.Enabled  = true;
                this.Btn_Print.Enabled = false;
                this.Btn_Print.Visible = false;
            }
            else
            {
                this.Btn_Print.Visible = this.HisFrmNode.IsPrint;
                this.Btn_Print.Enabled = this.HisFrmNode.IsPrint;
                this.Btn_Print.Attributes["onclick"] = "window.open('Print.aspx?FK_Node=" + this.FK_Node + "&FID=" + this.FID + "&FK_MapData=" + this.FK_MapData + "&WorkID=" + this.OID + "', '', 'dialogHeight: 350px; dialogWidth:450px; center: yes; help: no'); return false;";
            }
        }
Example #8
0
        public void EditSln()
        {
            FrmField sln = new FrmField();
            int      num = sln.Retrieve(FrmFieldAttr.FK_MapData, this.FK_MapData,
                                        FrmFieldAttr.KeyOfEn, this.KeyOfEn,
                                        FrmFieldAttr.FK_Node, this.FK_Node);

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

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

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

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

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

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

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

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

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

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

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

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

            Button btn = new Button();

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

            this.Pub1.AddFieldSet("独立表单中的数字签名设置方法");
            this.Pub1.AddBR("应用概述:");
            this.Pub1.AddBR("1, 一个独立表单上会有多出数字签名. ");
            this.Pub1.AddBR("2, 这些数字签名有时会读取以前的签名,有时需要当前的数字签名。");
            this.Pub1.AddBR("3, 如果当前方案需要读取以前的数字签名,那就清除默认值信息,否则就设置@WebUser.No 获取当前操作员的数字签名。");
            this.Pub1.AddFieldSetEnd();
        }
Example #9
0
        void btn_Field_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;

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

            //表单属性
            MapAttrs attrs = new MapAttrs();
            //增加排序
            QueryObject obj = new QueryObject(attrs);

            obj.AddWhere(MapAttrAttr.FK_MapData, this.FK_MapData);
            obj.addOrderBy(MapAttrAttr.Y, MapAttrAttr.X);
            obj.DoQuery();

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

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

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

                default:
                    break;
                }

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

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

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

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

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

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

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

                if (isChange == false)
                {
                    continue;
                }

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

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

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

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

            // 处理好.
            MapAttrs attrs = new MapAttrs();
            //增加排序
            QueryObject obj = new QueryObject(attrs);

            obj.AddWhere(MapAttrAttr.FK_MapData, this.FK_MapData);
            obj.addOrderBy(MapAttrAttr.Y, MapAttrAttr.X);
            obj.DoQuery();

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

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

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

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

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

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

            int idx = 0;

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

                default:
                    break;
                }

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

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

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

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

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


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

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


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

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

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

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

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

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

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

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

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

            Button btn = new Button();

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

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

            if (dtNodes.Rows.Count >= 1)
            {
                //btn = new Button();
                //btn.ID = "Btn_Copy";
                ////btn.Click += new EventHandler(btn_Field_Click);
                //btn.Text = " Copy From Node ";
                //btn.Attributes["onclick"] = "";
                this.Pub2.Add("<input type=button value='从其他节点上赋值权限' onclick=\"javascript:CopyIt('" + this.FK_MapData + "','" + this.FK_Flow + "','" + this.FK_Node + "')\">"); //删除定义..
            }
        }