コード例 #1
0
    protected void FormView2_DataBound(object sender, EventArgs e)
    {
        if (FormView2.CurrentMode == FormViewMode.ReadOnly)
        {
            if (FormView2.DataItemCount > 0)
            {
                DataRowView rowView    = (DataRowView)FormView2.DataItem;
                string      ls_val     = rowView["wrsp_uid"].ToString();
                int         li_respNum = Convert.ToInt32(rowView["wrsp_RespNum"]);
                woUsersBLL  userLogic  = new woUsersBLL();
                ls_val = userLogic.GetFullNameByID(Convert.ToInt32(ls_val));
                ((Label)FormView2.FindControl("UIDlabel")).Text = ls_val;
            }
        }

        if (Request.QueryString["wrsp_RespNum"].ToString() != "0")
        {
            ((TextBox)(FormView2.FindControl("txtBxHeader"))).Text = "Response to Work Order Response # " +
                                                                     Request.QueryString["wrsp_RespNum"].ToString();
        }
        else
        {
            ((TextBox)(FormView2.FindControl("txtBxHeader"))).Text = "Response to Work Order # " +
                                                                     Request.QueryString["word_WOnum"].ToString();
        }
    }
コード例 #2
0
ファイル: EditWO.aspx.cs プロジェクト: jlpatton/AuditBenefits
    protected void FormView2_DataBound(object sender, EventArgs e)
    {
        if (FormView2.DataItemCount > 0)
        {
            int         li_r2r;
            DataRowView rowView = (DataRowView)FormView2.DataItem;
            string      ls_val  = rowView["wrsp_uid"].ToString();
            li_respNum = Convert.ToInt32(rowView["wrsp_RespNum"]);
            if (rowView["wrsp_RespToResp"] != DBNull.Value)
            {
                li_r2r = Convert.ToInt32(rowView["wrsp_RespToResp"].ToString());
            }
            else
            {
                li_r2r = 0;
            }
            woUsersBLL userLogic = new woUsersBLL();
            ls_val = userLogic.GetFullNameByID(Convert.ToInt32(ls_val));
            ((Label)FormView2.FindControl("wrsp_uidLabel")).Text = ls_val;

            TextBox txtBx = (TextBox)(FormView2.FindControl("txtBxHeader"));

            if (li_r2r != 0)
            {
                txtBx.Text = "Response to Work Order Response # " +
                             li_r2r.ToString();
                txtBx.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                txtBx.Text = "Response to Work Order # " +
                             Request.QueryString["word_WOnum"].ToString();
            }
        }
    }
コード例 #3
0
    protected void FormView1_PreRender(object sender, EventArgs e)
    {
        DataView dv = (DataView)ObjectDataSource1.Select();

        if (dv.Count > 0)
        {
            DataRow  dr = (DataRow)dv.Table.Rows[0];
            FormView fv = sender as FormView;

            woUsersBLL userLogic = new woUsersBLL();
            string     ls_usr    = userLogic.GetFullNameByID(Convert.ToInt32(User.Identity.Name.Substring(User.Identity.Name.IndexOf("\\") + 1)));

            if (fv.CurrentMode == FormViewMode.Insert)
            {
                string usr = User.Identity.Name.Substring(User.Identity.Name.IndexOf("\\") + 1);

                Label LblAuthor = (Label)fv.Row.FindControl("LblAuthor");
                LblAuthor.Text    = ls_usr;
                LblAuthor.Enabled = false;

                Label LblPhase = (Label)fv.Row.FindControl("LblPhase");
                LblPhase.Text    = "Initial Work Order Request";
                LblPhase.Enabled = false;

                //DropDownList DropDownListPhaseStat = (DropDownList)fv.Row.FindControl("DropDownListPhaseStat");

                DataRowView rowView = (DataRowView)(FormView1.DataItem);
                if ((rowView != null))
                {
                    string ls_val = rowView["word_PMorSME"].ToString();
                    if (((DropDownList)FormView1.FindControl("DropDownList2")).Items.FindByValue(ls_val) != null)
                    {
                        ((DropDownList)FormView1.FindControl("DropDownList2")).SelectedValue = ls_val;
                    }
                    else
                    {
                        ((DropDownList)FormView1.FindControl("DropDownList2")).Items.Add(new ListItem(ls_val, ls_val));
                    }

                    ls_val = rowView["word_BusnOwner"].ToString();
                    if (((DropDownList)FormView1.FindControl("DropDownList3")).Items.FindByValue(ls_val) != null)
                    {
                        ((DropDownList)FormView1.FindControl("DropDownList3")).SelectedValue = ls_val;
                    }
                }
            }
        }
    }
コード例 #4
0
    protected void btnApprove_Click(object sender, EventArgs e)
    {
        woUsersBLL userLogic = new woUsersBLL();

        btnUpdate.Visible     = true;
        Label1.Visible        = true;
        Label2.Visible        = true;
        Label3.Visible        = true;
        Label4.Visible        = true;
        Label5.Visible        = true;
        chkBxApproval.Visible = true;
        txtBxPassword.Visible = true;
        txtBxComments.Visible = true;
        txtBxUser.Visible     = true;
        txtBxUser.Text        = userLogic.GetFullNameByID(Convert.ToInt32(User.Identity.Name.Substring(User.Identity.Name.IndexOf("\\") + 1)));
    }