예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapData       md      = new MapData(this.FK_MapData);
            FrmAttachment athDesc = new FrmAttachment();
            int           i       = athDesc.Retrieve(FrmAttachmentAttr.FK_MapData,
                                                     this.FK_MapData, FrmAttachmentAttr.NoOfObj, "DocMainAth");

            if (i == 0)
            {
                /*如果没有数据.*/
                /*如果没有查询到它,就有可能是公文多附件被删除了.*/
                athDesc.NoOfObj    = "DocMainAth";
                athDesc.Exts       = "doc,docx,xls,xlsx";
                athDesc.MyPK       = athDesc.FK_MapData + "_" + athDesc.NoOfObj;
                athDesc.FK_MapData = this.FK_MapData;


                //存储路径.
                string path = Server.MapPath("/DataUser/UploadFile/");
                path          += "\\F" + this.FK_Flow + "MainAth";
                athDesc.SaveTo = path;

                //位置.
                athDesc.X = (float)94.09;
                athDesc.Y = (float)140.18;
                athDesc.W = (float)626.36;
                athDesc.H = (float)150;

                //多附件.
                athDesc.UploadType = AttachmentUploadType.Single;
                athDesc.Name       = "公文正文(系统自动增加)";
                athDesc.SetValByKey("AtPara",
                                    "@IsWoEnablePageset=1@IsWoEnablePrint=1@IsWoEnableViewModel=1@IsWoEnableReadonly=0@IsWoEnableSave=1@IsWoEnableWF=1@IsWoEnableProperty=1@IsWoEnableRevise=1@IsWoEnableIntoKeepMarkModel=1@FastKeyIsEnable=0@IsWoEnableViewKeepMark=1@FastKeyGenerRole=@IsWoEnableTemplete=1");
                athDesc.Insert();

                //有可能在其其它的节点上没有这个附件,所以也要循环增加上它.
                BP.WF.Nodes nds = new Nodes(this.FK_Flow);
                foreach (Node nd in nds)
                {
                    athDesc.FK_MapData = "ND" + nd.NodeID;
                    athDesc.MyPK       = athDesc.FK_MapData + "_" + athDesc.NoOfObj;
                    if (athDesc.IsExits == true)
                    {
                        continue;
                    }
                    athDesc.Insert();
                }

                //重新查询一次,把默认值加上.
                athDesc.RetrieveFromDBSources();
            }

            FrmAttachmentDBs athDBs = null;

            athDBs = new FrmAttachmentDBs(this.FK_MapData, this.WorkID.ToString());

            FrmAttachmentDB athDB = null;

            if (athDBs.Count == 0 && this.IsCC == "1")
            {
                /*如果是抄送过来的, 有可能是抄送到的节点不是发送到的节点,导致附件数据没有copy。
                 * 也就是说,发给b节点,但是抄送到c节点上去了,导致c节点上的人看不到附件数据。*/

                CCList cc  = new CCList();
                int    nnn = cc.Retrieve(CCListAttr.FK_Node, this.FK_Node, CCListAttr.WorkID, this.WorkID, CCListAttr.CCTo, WebUser.No);
                this._fk_node = cc.NDFrom;
                if (cc.NDFrom != 0)
                {
                    athDBs.Retrieve(FrmAttachmentDBAttr.FK_MapData, "ND" + cc.NDFrom, FrmAttachmentDBAttr.RefPKVal, this.WorkID.ToString());

                    string ndFromMapdata = athDesc.MyPK.Replace(athDesc.FK_MapData, "ND" + cc.NDFrom);
                    athDB = athDBs.GetEntityByKey(FrmAttachmentDBAttr.FK_FrmAttachment, ndFromMapdata) as FrmAttachmentDB;
                    //重新设置文件描述。
                    athDesc.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData, FrmAttachmentAttr.NoOfObj, "DocMainAth");
                }
            }
            else
            {
                /* 单个文件 */
                athDB = athDBs.GetEntityByKey(FrmAttachmentDBAttr.FK_FrmAttachment, athDesc.MyPK) as FrmAttachmentDB;
            }


            Label lab = new Label();

            lab.ID = "Lab" + athDesc.MyPK;
            this.Pub1.Add(lab);
            if (athDB != null)
            {
                if (athDB.FileExts == "ceb")
                {
                    athDB.FileExts = "pdf";
                }
                if (athDesc.IsWoEnableWF)
                {
                    lab.Text = "<a  href=\"javascript:OpenOfiice('" + athDB.FK_FrmAttachment + "','" + this.WorkID + "','" + athDB.MyPK + "','" + this.FK_MapData + "','" + athDesc.NoOfObj + "','" + this.FK_Node + "')\"><img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/FileType/" + athDB.FileExts + ".gif' border=0/>" + athDB.FileName + "</a>";
                }
                else
                {
                    lab.Text = "<img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/FileType/" + athDB.FileExts + ".gif' border=0/>" + athDB.FileName;
                }
            }

            #region 处理权限问题.
            // 处理权限问题, 有可能当前节点是可以上传或者删除,但是当前节点上不能让此人执行工作。
            bool isDel    = athDesc.IsDeleteInt == 0 ? false : true;
            bool isUpdate = athDesc.IsUpload;
            if (isDel == true || isUpdate == true)
            {
                if (this.WorkID != 0 &&
                    string.IsNullOrEmpty(this.FK_Flow) == false)
                {
                    isDel = BP.WF.Dev2Interface.Flow_IsCanDoCurrentWork(this.FK_Flow, this.FK_Node, this.WorkID, WebUser.No);
                    if (isDel == false)
                    {
                        isUpdate = false;
                    }
                }
            }
            #endregion 处理权限问题.

            Button mybtn = new Button();
            mybtn.CssClass = "Btn";

            if (athDesc.IsUpload && isUpdate == true)
            {
                FileUpload fu = new FileUpload();
                fu.ID                     = athDesc.MyPK;
                Btn_Upload.ID             = "Btn_Upload_" + athDesc.MyPK + "_" + this.WorkID;
                fu.Attributes["Width"]    = athDesc.W.ToString();
                fu.Attributes["onchange"] = "UploadChange('" + mybtn.ID + "');";
                this.Pub1.Add(fu);
            }

            if (athDesc.IsDownload)
            {
                mybtn          = new Button();
                mybtn.Text     = "下载";
                mybtn.CssClass = "Btn";

                mybtn.ID       = "Btn_Download_" + athDesc.MyPK + "_" + this.WorkID;
                mybtn.Click   += new EventHandler(btnUpload_Click);
                mybtn.CssClass = "bg";
                if (athDB == null)
                {
                    mybtn.Visible = false;
                }
                else
                {
                    mybtn.Visible = true;
                }
                this.Pub1.Add(mybtn);
            }

            if (this.IsReadonly == false)
            {
                if (athDesc.IsDeleteInt != 0 && isDel == true)
                {
                    bool isDeleteBtn = true;
                    if (athDesc.IsDeleteInt == 2)
                    {
                        if (!athDB.Rec.Equals(WebUser.No))
                        {
                            isDeleteBtn = false;
                        }
                    }
                    if (isDeleteBtn)
                    {
                        mybtn          = new Button();
                        mybtn.CssClass = "Btn";
                        mybtn.Text     = "删除";
                        mybtn.Attributes["onclick"] = " return confirm('您确定要执行删除吗?');";
                        mybtn.ID       = "Btn_Delete_" + athDesc.MyPK + "_" + this.WorkID;
                        mybtn.Click   += new EventHandler(btnUpload_Click);
                        mybtn.CssClass = "bg";
                        if (athDB == null)
                        {
                            mybtn.Visible = false;
                        }
                        else
                        {
                            mybtn.Visible = true;
                        }
                        this.Pub1.Add(mybtn);
                    }
                }

                if (athDesc.IsWoEnableWF)
                {
                    mybtn          = new Button();
                    mybtn.CssClass = "Btn";
                    mybtn.Text     = "打开";
                    mybtn.ID       = "Btn_Open_" + athDesc.MyPK + "_" + this.WorkID;
                    mybtn.Click   += new EventHandler(btnUpload_Click);
                    mybtn.CssClass = "bg";
                    if (athDB == null)
                    {
                        mybtn.Visible = false;
                    }
                    else
                    {
                        mybtn.Visible = true;
                    }
                    this.Pub1.Add(mybtn);
                }
            }
        }
예제 #2
0
        private void InitOffice(bool isMenu)
        {
            bool isCompleate = false;

            BP.WF.Node node = new BP.WF.Node();
            node.NodeID = int.Parse(this.FK_Node);
            node.RetrieveFromDBSources();
            try
            {
                WorkFlow workFlow = new WorkFlow(node.FK_Flow, Int64.Parse(PKVal));
                isCompleate = workFlow.IsComplete;
            }
            catch (Exception)
            {
                try
                {
                    Flow  fl  = new Flow(node.FK_Flow);
                    GERpt rpt = fl.HisGERpt;
                    rpt.OID = Int64.Parse(PKVal);
                    rpt.Retrieve();

                    if (rpt != null)
                    {
                        if (rpt.WFState == WFState.Complete)
                        {
                            isCompleate = true;
                        }
                    }
                }
                catch
                {
                }
            }
            if (!isCompleate)
            {
                try
                {
                    isCompleate = !BP.WF.Dev2Interface.Flow_IsCanDoCurrentWork(node.FK_Flow, node.NodeID, Int64.Parse(PKVal), WebUser.No);
                    //WorkFlow workFlow = new WorkFlow(node.FK_Flow, Int64.Parse(PKVal));
                    //isCompleate = !workFlow.IsCanDoCurrentWork(WebUser.No);
                }
                catch
                {
                }
            }

            FrmAttachment attachment = new FrmAttachment();
            int           result     = 0;

            //表单编号与节点不为空
            if (this.FK_MapData != null && this.FK_Node != null)
            {
                BP.En.QueryObject objInfo = new BP.En.QueryObject(attachment);
                objInfo.AddWhere(FrmAttachmentAttr.FK_MapData, this.FK_MapData);
                objInfo.addAnd();
                objInfo.AddWhere(FrmAttachmentAttr.FK_Node, this.FK_Node);
                objInfo.addAnd();
                objInfo.AddWhere(FrmAttachmentAttr.NoOfObj, this.NoOfObj);
                result = objInfo.DoQuery();
                //result = attachment.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData,
                //                            FrmAttachmentAttr.FK_Node, this.FK_Node, FrmAttachmentAttr.NoOfObj, this.DelPKVal);
            }
            if (result == 0) /*如果没有定义,就获取默认的.*/
            {
                attachment.MyPK = this.FK_FrmAttachment;
                attachment.Retrieve();
            }
            if (!isCompleate)
            {
                if (attachment.IsWoEnableReadonly)
                {
                    ReadOnly = true;
                }
                if (attachment.IsWoEnableCheck)
                {
                    IsCheck = true;
                }
                IsMarks = attachment.IsWoEnableMarks;
            }
            else
            {
                if (attachment.IsWoEnableReadonly)
                {
                    ReadOnly = true;
                }
            }
            if (isMenu && !isCompleate)
            {
                #region 初始化按钮
                if (attachment.IsWoEnableViewKeepMark)
                {
                    divMenu.InnerHtml = "<select id='marks' onchange='ShowUserName()'  style='width: 100px'><option value='1'>显示留痕</option><option value='2'>隐藏留痕</option><select>";
                }

                if (attachment.IsWoEnableTemplete)
                {
                    AddBtn("openTempLate", "打开模板", "OpenTempLate");
                }
                if (attachment.IsWoEnableSave)
                {
                    AddBtn("saveFile", "保存", "saveOffice");
                }
                if (attachment.IsWoEnableRevise)
                {
                    AddBtn("accept", "接受修订", "acceptOffice");
                    AddBtn("refuse", "拒绝修订", "refuseOffice");
                }

                if (attachment.IsWoEnableOver)
                {
                    AddBtn("over", "套红文件", "overOffice");
                }


                if (attachment.IsWoEnableSeal)
                {
                    AddBtn("seal", "签章", "sealOffice");
                }
                if (attachment.IsWoEnableInsertFlow)
                {
                    AddBtn("flow", "插入流程图", "InsertFlow");
                }
                if (attachment.IsWoEnableInsertFlow)
                {
                    AddBtn("fegnxian", "插入风险点", "InsertFengXian");
                }

                #endregion
            }

            #region   初始化文件

            FrmAttachmentDB downDB = new FrmAttachmentDB();

            downDB.MyPK = this.DelPKVal;
            downDB.Retrieve();
            fileName.Text = downDB.FileName;
            fileType.Text = downDB.FileExts;
            RealFileName  = downDB.FileName;
            FileFullName  = downDB.FileFullName;
            FileSavePath  = attachment.SaveTo;

            #endregion
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FrmAttachment ath = new FrmAttachment();

            ath.FK_MapData = this.FK_MapData;
            ath.NoOfObj    = this.Ath;
            ath.FK_Node    = this.FK_Node;

            if (this.FK_Node == 0)
            {
                ath.MyPK = this.FK_MapData + "_" + this.Ath;
            }
            else
            {
                ath.MyPK = this.FK_MapData + "_" + this.Ath + "_" + this.FK_Node;
            }

            int i = ath.RetrieveFromDBSources();

            if (i == 0 && this.FK_Node != 0)
            {
                /*这里处理 独立表单解决方案, 如果有FK_Node 就说明该节点需要单独控制该附件的属性. */
                MapData mapData = new MapData();
                mapData.RetrieveByAttr(MapDataAttr.No, this.FK_MapData);
                if (mapData.AppType == "0")
                {
                    FrmAttachment souceAthMent = new FrmAttachment();
                    // 查询出来原来的数据.
                    int rowCount = souceAthMent.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData, FrmAttachmentAttr.NoOfObj, this.Ath, FrmAttachmentAttr.FK_Node, "0");
                    if (rowCount > 0)
                    {
                        ath.Copy(souceAthMent);
                    }
                }
                if (this.FK_Node == 0)
                {
                    ath.MyPK = this.FK_MapData + "_" + this.Ath;
                }
                else
                {
                    ath.MyPK = this.FK_MapData + "_" + this.Ath + "_" + this.FK_Node;
                }

                //插入一个新的.
                ath.FK_Node    = this.FK_Node;
                ath.FK_MapData = this.FK_MapData;
                ath.NoOfObj    = this.Ath;
                ath.DirectInsert();
            }

            #region 基本属性.
            this.Title = "附件属性设置";
            this.Pub1.AddTable();
            this.Pub1.AddCaption("附件属性设置");

            int idx = 0;
            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTDTitle("colspan=3", "基本属性");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            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.AddTDIdx(idx++);
            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.AddTDIdx(idx++);
            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.AddTDIdx(idx++);
            this.Pub1.AddTD("文件数据存储方式");

            DDL ddl = new DDL();
            ddl.ID = "DDL_" + FrmAttachmentAttr.SaveWay;
            ddl.Items.Add(new ListItem("按文件方式保存", "0"));
            ddl.Items.Add(new ListItem("保存到数据库", "1"));
            ddl.SetSelectItem(ath.SaveWay);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("上传的附件如何保存?");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            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.AddTDIdx(idx++);
            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.AddTDIdx(idx++);
            this.Pub1.AddTD("colspan=3", "帮助:类别可以为空,设置的格式为:列头显示名称@类别名1,类别名2,类别名3(列头显示名称@ :可以不写,默认为:类别)");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("完整性校验");

            //  BP.Web.Controls.DDL ddl=new DDL();
            ddl    = new DDL();
            ddl.ID = "DDL_UploadFileNumCheck";
            ddl.BindSysEnum("UploadFileCheck", (int)ath.UploadFileNumCheck);
            this.Pub1.AddTD("colspan=2", ddl);
            this.Pub1.AddTREnd();


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

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

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsShowTitle;
            cb.Text    = "是否显示标题列";
            cb.Checked = ath.IsShowTitle;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsVisable;
            cb.Text    = "是否可见(不打勾就隐藏,隐藏后就显示不到表单上,可以显示在组件里.)";
            cb.Checked = ath.IsVisable;
            this.Pub1.AddTD("colspan=3", cb);
            this.Pub1.AddTREnd();


            GroupFields gfs = new GroupFields(ath.FK_MapData);

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示在分组");
            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=1", ddl);
            this.Pub1.AddTD("对傻瓜表单有效");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("展现方式");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + FrmAttachmentAttr.FileShowWay;
            ddl.Items.Clear();
            ddl.Items.Add(new ListItem("Table方式", "0"));
            ddl.Items.Add(new ListItem("图片轮播方式", "1"));
            ddl.Items.Add(new ListItem("自由模式", "2"));

            ddl.SelectedValue = Convert.ToString((int)ath.FileShowWay);
            this.Pub1.AddTD("colspan=2", ddl);
            this.Pub1.AddTREnd();
            #endregion 基本属性.


            #region 权限控制.
            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTDTitle("colspan=3", "权限控制" + BP.WF.Glo.GenerHelpCCForm("帮助", null, null));
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsDownload;
            cb.Text    = "是否可下载";
            cb.Checked = ath.IsDownload;
            this.Pub1.AddTD(cb);


            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + FrmAttachmentAttr.IsDelete;
            ddl.Items.Clear();
            ddl.Items.Add(new ListItem("不能删除", "0"));
            ddl.Items.Add(new ListItem("删除所有", "1"));
            ddl.Items.Add(new ListItem("只能删除自己上传的", "2"));
            ddl.SetSelectItem(ath.IsDeleteInt);
            this.Pub1.AddTD(ddl);

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

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsOrder;
            cb.Text    = "是否可以排序";
            cb.Checked = ath.IsOrder;
            this.Pub1.AddTD(cb);

            this.Pub1.AddTD("使用上传控件方式");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + FrmAttachmentAttr.UploadCtrl;
            ddl.Items.Clear();
            ddl.Items.Add(new ListItem("批量上传", "0"));
            ddl.Items.Add(new ListItem("普通上传", "1"));
            ddl.SetSelectItem(ath.UploadCtrl);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTREnd();

            if (ath.IsNodeSheet == true)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("数据显示控制方式");
                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_CtrlWay";
                ddl.Items.Clear();
                ddl.Items.Add(new ListItem("按主键", "0"));
                ddl.Items.Add(new ListItem("FID", "1"));
                ddl.Items.Add(new ListItem("ParentWorkID", "2"));
                ddl.Items.Add(new ListItem("仅可以查看自己上传数据", "3"));
                ddl.SetSelectItem((int)ath.HisCtrlWay);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("子线程节点控制(对节点表单有效)");
                cb         = new CheckBox();
                cb.ID      = "CB_" + FrmAttachmentAttr.IsToHeLiuHZ;
                cb.Text    = "该附件是否要汇总到合流节点上去?(对子线程节点有效)";
                cb.Checked = ath.IsToHeLiuHZ;
                this.Pub1.AddTD("colspan=2", cb);
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("合流节点控制(对节点表单有效)");
                cb         = new CheckBox();
                cb.ID      = "CB_" + FrmAttachmentAttr.IsHeLiuHuiZong;
                cb.Text    = "是否是合流节点的汇总附件组件?(对合流节点有效)";
                cb.Checked = ath.IsHeLiuHuiZong;
                this.Pub1.AddTD("colspan=2", cb);
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("数据上传控制方式");
                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_AthUploadWay";
                ddl.Items.Clear();
                ddl.Items.Add(new ListItem("继承模式", "0"));
                ddl.Items.Add(new ListItem("协作模式", "1"));
                ddl.SetSelectItem((int)ath.AthUploadWay);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTREnd();
                this.Pub1.AddTREnd();
            }
            #endregion 权限控制.



            #region WebOffice控制方式.

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTDTitle("colspan=3", "WebOffice控制方式(如果上传的是excel word附件,在打开的时候对其的控制).");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableWF;
            cb.Text    = "是否启用weboffice?";
            cb.Checked = ath.IsWoEnableWF;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableSave;
            cb.Text    = "是否启用保存?";
            cb.Checked = ath.IsWoEnableSave;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableReadonly;
            cb.Text    = "是否只读?";
            cb.Checked = ath.IsWoEnableReadonly;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();



            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableRevise;
            cb.Text    = "是否启用修订?";
            cb.Checked = ath.IsWoEnableRevise;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableViewKeepMark;
            cb.Text    = "是否查看用户留痕?";
            cb.Checked = ath.IsWoEnableViewKeepMark;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnablePrint;
            cb.Text    = "是否打印?";
            cb.Checked = ath.IsWoEnablePrint;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableOver;
            cb.Text    = "是否启用套红?";
            cb.Checked = ath.IsWoEnableOver;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableSeal;
            cb.Text    = "是否启用签章?";
            cb.Checked = ath.IsWoEnableSeal;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableTemplete;
            cb.Text    = "是否启用模板文件?";
            cb.Checked = ath.IsWoEnableTemplete;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableCheck;
            cb.Text    = "是否记录节点信息?";
            cb.Checked = ath.IsWoEnableCheck;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableInsertFlow;
            cb.Text    = "是否启用插入流程?";
            cb.Checked = ath.IsWoEnableInsertFlow;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableInsertFengXian;
            cb.Text    = "是否启用插入风险点?";
            cb.Checked = ath.IsWoEnableInsertFengXian;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableMarks;
            cb.Text    = "是否进入留痕模式?";
            cb.Checked = ath.IsWoEnableMarks;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableDown;
            cb.Text    = "是否启用下载?";
            cb.Checked = ath.IsWoEnableDown;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();


            this.Pub1.AddTREnd();
            #endregion WebOffice控制方式.

            #region 快捷键生成规则.
            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTDTitle("colspan=3", "快捷键生成规则.");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.FastKeyIsEnable;
            cb.Text    = "是否启用生成快捷键?(启用就会按照规则生成放在附件的同一个目录里面)";
            cb.Checked = ath.FastKeyIsEnable;
            this.Pub1.AddTD("colspan=3", cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            tb         = new BP.Web.Controls.TB();
            tb.ID      = "TB_" + FrmAttachmentAttr.FastKeyGenerRole;
            tb.Text    = ath.FastKeyGenerRole;
            tb.Columns = 30;
            this.Pub1.AddTD("colspan=3", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("colspan=3", "格式:*FiledName.*OID");
            this.Pub1.AddTREnd();
            #endregion 快捷键生成规则.

            #region 保存按钮.
            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            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();
            #endregion 保存按钮.

            this.Pub1.AddTableEnd();
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string action = Request["action"];

            string name = null;

            if (BP.Web.WebUser.No == "Guest")
            {
                name = BP.Web.GuestUser.Name;
            }
            else
            {
                name = BP.Web.WebUser.Name;
            }
            TB_User.Value = name;


            FrmAttachmentDB downDB = new FrmAttachmentDB();

            if (DoType.Equals("EditOffice"))
            {
                if (!string.IsNullOrEmpty(DelPKVal))
                {
                    downDB.MyPK = this.DelPKVal;
                    downDB.Retrieve();
                    TB_FilePath.Value = downDB.FileFullName;
                    TB_FileType.Value = downDB.FileExts;
                }
                if (!string.IsNullOrEmpty(this.FK_FrmAttachment))
                {
                    FrmAttachment attachment = new FrmAttachment();
                    int           result     = 0;
                    //表单编号与节点不为空
                    if (this.FK_MapData != null && this.FK_Node != null)
                    {
                        BP.En.QueryObject objInfo = new BP.En.QueryObject(attachment);
                        objInfo.AddWhere(FrmAttachmentAttr.FK_MapData, this.FK_MapData);
                        objInfo.addAnd();
                        objInfo.AddWhere(FrmAttachmentAttr.FK_Node, this.FK_Node);
                        objInfo.addAnd();
                        objInfo.AddWhere(FrmAttachmentAttr.NoOfObj, this.NoOfObj);
                        result = objInfo.DoQuery();
                        //result = attachment.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData,
                        //                            FrmAttachmentAttr.FK_Node, this.FK_Node, FrmAttachmentAttr.NoOfObj, this.DelPKVal);
                    }
                    if (result == 0) /*如果没有定义,就获取默认的.*/
                    {
                        attachment.MyPK = this.FK_FrmAttachment;
                        attachment.Retrieve();
                    }

                    if (!attachment.IsWoEnableSave)
                    {
                        Btn_Save.Visible = false;
                    }
                    if (attachment.IsWoEnableReadonly)
                    {
                        TB_IsReadOnly.Value = "1";
                    }
                    else
                    {
                        TB_IsReadOnly.Value = "0";
                    }

                    if (!attachment.IsWoEnableRevise)
                    {
                        Btn_AttachDoc.Visible   = false;
                        Btn_UnAttachDoc.Visible = false;
                    }

                    if (!attachment.IsWoEnablePrint)
                    {
                        TB_IsPrint.Value = "0";
                    }
                    else
                    {
                        TB_IsPrint.Value = "1";
                    }

                    if (!attachment.IsWoEnableViewKeepMark)
                    {
                        sShowName.Visible = false;
                    }
                }
            }

            if (!string.IsNullOrEmpty(action))
            {
                if (action.Equals("SaveFile"))
                {
                    SaveFile();
                }
                else if (action.Equals("LoadFile"))
                {
                    LoadFile();
                }
                else if (action.Equals("LoadFlow"))
                {
                    GetFlow();
                }
            }
        }