Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!AspxHelper.IsAuthenticated)
        {
            FormsAuthentication.RedirectToLoginPage();
        }

        string          appName         = this.Request.QueryString["app"];
        FormApplication formApplication = null;
        BPMConnection   cn = new BPMConnection();

        try
        {
            cn.WebOpen(this.Page);
            formApplication = FormApplication.Load(cn, appName);
        }
        finally
        {
            cn.Close();
        }

        string formFile = formApplication.Form;

        if (formFile.IndexOf('?') != -1)
        {
            this.Server.Transfer(this.ResolveClientUrl("../Forms/") + formFile + "&md=App&" + this.Request.QueryString.ToString(), false);
        }
        else
        {
            this.Server.Transfer(this.ResolveClientUrl("../Forms/") + formFile + "?md=App&" + this.Request.QueryString.ToString(), false);
        }

        this.Response.End();
    }
Example #2
0
 protected void _treeView_TreeNodePopulate(object sender, TreeNodeEventArgs e)
 {
     if (this.Page.IsCallback)
     {
         if (e.Node.ChildNodes.Count == 0)
         {
             BPMConnection cn = new BPMConnection();
             try
             {
                 cn.WebOpen(this.Page);
                 LoadChildNode(cn, e.Node);
             }
             finally
             {
                 cn.Close();
             }
         }
     }
 }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!AspxHelper.IsAuthenticated)
        {
            FormsAuthentication.RedirectToLoginPage();
        }

        this.Page.ClientScript.RegisterClientScriptInclude("FormScript", this.ResolveClientUrl("../Scripts/XForm.js"));

        BPMConnection cn = new BPMConnection();

        if (this._treeView.Nodes.Count != 0)
        {
            return;
        }

        try
        {
            cn.WebOpen(this.Page);

            OUCollection ous = cn.GetRootOUs();

            SecurityToken token = cn.Token;
            foreach (OU ou in ous)
            {
                TreeNode node = CreateNode(ou);
                this._treeView.Nodes.Add(node);

                TreeNode firstDeptNode = null;
                OnNodeCreated(cn, ou, node, token, ref firstDeptNode);
                if (firstDeptNode != null)
                {
                    firstDeptNode.Selected = true;
                }
            }
        }
        finally
        {
            cn.Close();
        }
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            ClientScriptManager cs = this.Page.ClientScript;

            if (!cs.IsClientScriptIncludeRegistered("MyScript"))
            {
                cs.RegisterClientScriptInclude("MyScript", this.ResolveClientUrl("../Scripts/Main.js"));
            }

            if (!cs.IsClientScriptIncludeRegistered("FormScript"))
            {
                cs.RegisterClientScriptInclude("FormScript", this.Page.ResolveClientUrl("../Scripts/Form.js"));
            }

            if (!cs.IsClientScriptIncludeRegistered("XFormScript"))
            {
                cs.RegisterClientScriptInclude("XFormScript", this.Page.ResolveClientUrl("../Scripts/XForm.js"));
            }

            //获得ColumnInfo
            string datasourceName = this.Request.QueryString["ds"];
            string tableName      = this.Request.QueryString["table"];
            string orderBy        = this.Request.QueryString["orderby"];
            this._columnInfos = this.ParseColumnInfos(this.Request.QueryString["cinfs"]);
            this._columnInfos.ParseFixFilter(this.Page, this.Request.QueryString["fcols"]);
            bool ms         = this.Request.QueryString["ms"] == "1" ? true : false;
            bool hiddenlink = this.Request.QueryString["hl"] == "1" ? true : false;

            if (ms)
            {
                this._bs.Visible       = true;
                this._bs.OnClientClick = String.Format("F_CloseDialogNBat(mlist,{0},'{1}','');return false;",
                                                       this.Request.QueryString["idx"],
                                                       Resources.BPMResource.DataBrowser_Msg_AtleastSelOne);
            }
            else
            {
                this._bs.Visible = false;
            }

            //初始化页导航条
            this.Page.Header.Title = tableName;
            this._navigateBar.InitState();

            //获得数据
            TableRow  row;
            TableCell cell;

            BPMConnection cn       = new BPMConnection();
            FlowDataTable schema   = null;
            FlowDataTable table    = null;
            int           rowcount = 0;
            try
            {
                cn.WebOpen(Page);

                //获得表的Schema
                schema = DataSourceManager.LoadTableSchema(cn, datasourceName, tableName);

                //规则化显示行
                if (this._columnInfos.DisplayColumnCount == 0) //没有显示行
                {
                    //有map则显示map列
                    if (this._columnInfos.MapColumnCount != 0)
                    {
                        foreach (MyColumnInfo column in this._columnInfos)
                        {
                            if (column.Map)
                            {
                                column.Display = true;
                            }
                        }
                    }
                    else //没有则显示所有列
                    {
                        foreach (FlowDataColumn column in schema.Columns)
                        {
                            MyColumnInfo columnInfo = this._columnInfos.TryGetColumn(column.ColumnName);
                            if (columnInfo == null)
                            {
                                columnInfo = new MyColumnInfo(column.ColumnName, true, false, column.ColumnName);
                            }

                            columnInfo.Display = true;
                            this._columnInfos.Add(columnInfo);
                        }
                    }
                }

                foreach (MyColumnInfo column in this._columnInfos)
                {
                    FlowDataColumn dbcolumn = schema.Columns.TryGetItem(column.ColumnName);
                    if (dbcolumn != null)
                    {
                        column.AllowSearch = dbcolumn.AllowSearch;
                    }
                }

                BPMDBParameterCollection parameters = GetSelectParameters(this._columnInfos);

                //获得数据
                table = DataSourceManager.LoadTableDataPaged(cn, datasourceName, tableName, this._columnInfos.AllOutputColumnNames, parameters, orderBy, (this._navigateBar.CurPage - 1) * this._navigateBar.PageSize, this._navigateBar.PageSize, out rowcount);
                this._navigateBar.ItemCount = rowcount;
            }
            finally
            {
                cn.Close();
            }

            //建立ComboBox
            this._schType.Items.Add(new ListItem(Resources.BPMResource.Com_All, "all"));
            foreach (MyColumnInfo column in this._columnInfos)
            {
                if (!column.Display || column.FixFilter || !column.AllowSearch)
                {
                    continue;
                }

                this._schType.Items.Add(new ListItem(column.DisplayName, column.ColumnName));
            }

            //设置状态值
            this._schBox.Text           = this.Request.QueryString["sch"];
            this._schType.SelectedValue = this.Request.QueryString["schtype"];

            //建立List的Header
            row = CreateHeaderRow();
            this._table.Rows.Add(row);

            //获得按SELECT排序的DisplayColumn
            MyColumnInfoCollection displayColumnsOrdered = new MyColumnInfoCollection();
            foreach (FlowDataColumn tableColumn in schema.Columns)
            {
                MyColumnInfo columnInfo = this._columnInfos.TryGetColumn(tableColumn.ColumnName);
                if (columnInfo == null)
                {
                    continue;
                }

                if (!columnInfo.Display)
                {
                    continue;
                }

                displayColumnsOrdered.Add(columnInfo);
            }

            if (ms)
            {
                row.Cells.Add(CreateCheckColumn());
            }

            foreach (MyColumnInfo column in displayColumnsOrdered)
            {
                if (row.Cells.Count != 0)
                {
                    row.Cells.Add(CreateSepratorColumn());
                }

                cell = CreateColumn(column.DisplayName, -1);
                row.Cells.Add(cell);
            }

            //总记录数
            this._labCount.Text = rowcount.ToString();

            //添加行
            foreach (FlowDataRow dataRow in table.Rows)
            {
                row = CreateItemRow();
                this._table.Rows.Add(row);

                if (ms)
                {
                    cell            = new TableCell();
                    cell.Text       = "<input id=\"" + GetMapValue(this._columnInfos, dataRow) + "\" type=\"checkbox\" onclick=\"checkrow(this);\">";
                    cell.ColumnSpan = 1;

                    row.Cells.Add(cell);
                }

                foreach (MyColumnInfo column in displayColumnsOrdered)
                {
                    //列分割
                    if (row.Cells.Count != 0)
                    {
                        row.Cells.Add(CreateEmptyCell(1));
                    }

                    foreach (string key in dataRow.Keys)
                    {
                        object v = dataRow[key];
                    }

                    object value = dataRow[column.ColumnName];
                    if (row.Cells.Count == 0 && !hiddenlink)
                    {
                        HyperLink link = CreateSetValueLink(FormatValue(value), this._columnInfos, dataRow, this._table.Rows.Count - 1);
                        cell = CreateCell(String.Empty, 1);
                        cell.Controls.Add(link);
                    }
                    else
                    {
                        cell = CreateCell(FormatValue(value), 1);
                    }

                    //cell.Style.Add("text-align", "center");
                    row.Cells.Add(cell);
                }
            }
        }
    }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (String.Compare(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowMaintenancePage"], "true", true) == 0)
        {
            Response.Redirect("~/YZSoft/Maintenance/Default.aspx");
        }

        Guid itemguid = new Guid(Request.QueryString["ItemGuid"]);

        BPMConnection cn = new BPMConnection();

        try
        {
            //连接
            cn.WebOpenAnonymous(this.Page);

            //提交处理请求
            PostResult postResult = BPMTask.ClickToProcess(cn, itemguid);

            //获得处理结果
            string message;

            string customMessage = postResult.CustomMessage;
            if (!String.IsNullOrEmpty(customMessage))
            {
                customMessage = "\n[" + customMessage + "]";
            }

            switch (postResult.PostResultType)
            {
            case PostResultType.HasSentToOtherUsers:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_HasSentToOtherUsers, postResult.SN, YZStringHelper.GetUserNameListString(postResult.Recipients), customMessage);
                break;

            case PostResultType.InWaitingOtherUsers:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_InWaitingOtherUsers, postResult.SN, YZStringHelper.GetUserNameListString(postResult.Recipients), customMessage);
                break;

            case PostResultType.TaskInWaiting:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_TaskInWaiting, postResult.SN, customMessage);
                break;

            case PostResultType.TaskFinishedApproved:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_TaskFinishedApproved, postResult.SN, customMessage);
                break;

            case PostResultType.TaskFinishedRejected:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_TaskFinishedRejected, postResult.SN, customMessage);
                break;

            case PostResultType.RecedeRestarted:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_RecedeRestarted, postResult.SN, YZStringHelper.GetUserNameListString(postResult.Recipients), customMessage);
                break;

            default:
                message = String.Empty;
                break;
            }

            //输出处理结果
            Response.Write(message);
        }
        catch (Exception exp)
        {
            Response.Write(exp.Message);
        }
        finally
        {
            cn.Close();
        }
    }