Beispiel #1
0
    public PWPAudit Query_Audit(Guid id)
    {
        SqlParameter[] para = new SqlParameter[] {
            new SqlParameter("@PWP_ID", SqlDbType.UniqueIdentifier),
            new  SqlParameter("@PWP_MFDepSignSuggestion", SqlDbType.VarChar, 400),
            new  SqlParameter("@PWP_MFDepSignMan", SqlDbType.VarChar, 20),
            new   SqlParameter("@PWP_MFDepSignTime", SqlDbType.DateTime),
            new   SqlParameter("@PWP_MFDepSignResult", SqlDbType.VarChar, 20),
            new   SqlParameter("@PWP_MBossSignSuggestion", SqlDbType.VarChar, 400),
            new SqlParameter("@PWP_MBossSignMan", SqlDbType.VarChar, 20),
            new  SqlParameter("@PWP_MBossSignTime", SqlDbType.DateTime),
            new  SqlParameter("@PWP_MBossSignResult", SqlDbType.VarChar, 20),
            new   SqlParameter("@PWP_MPDepSignSuggestion", SqlDbType.VarChar, 400),
            new   SqlParameter("@PWP_MPDepSignMan", SqlDbType.VarChar, 20),
            new   SqlParameter("@PWP_MPDepSignTime", SqlDbType.DateTime),
            new   SqlParameter("@PWP_MPDepSignResult", SqlDbType.VarChar, 20),
        };
        para[0].Value      = id;
        para[1].Direction  = ParameterDirection.Output;
        para[2].Direction  = ParameterDirection.Output;
        para[3].Direction  = ParameterDirection.Output;
        para[4].Direction  = ParameterDirection.Output;
        para[5].Direction  = ParameterDirection.Output;
        para[6].Direction  = ParameterDirection.Output;
        para[7].Direction  = ParameterDirection.Output;
        para[8].Direction  = ParameterDirection.Output;
        para[9].Direction  = ParameterDirection.Output;
        para[10].Direction = ParameterDirection.Output;
        para[11].Direction = ParameterDirection.Output;
        para[12].Direction = ParameterDirection.Output;
        PWPAudit au = SqlHelper.ExecuteReturnPWPAuditQuery(SqlHelper.ConnectionStringLocalTransaction, CommandType.StoredProcedure, "Proc_S_PWPAudit", para);

        return(au);
    }
Beispiel #2
0
        public static PWPAudit ExecuteReturnPWPAuditQuery(string connectionString, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
        {
            SqlCommand cmd = new SqlCommand();

            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                PrepareCommand(cmd, conn, null, cmdType, cmdText, commandParameters);
                int      val = cmd.ExecuteNonQuery();
                PWPAudit au  = new PWPAudit();
                au.PWP_MFDepSignSuggestion1 = commandParameters[1].Value.ToString();
                au.PWP_MFDepSignMan1        = commandParameters[2].Value.ToString();
                au.PWP_MFDepSignTime1       = commandParameters[3].Value.ToString();
                au.PWP_MFDepSignResult1     = commandParameters[4].Value.ToString();
                au.PWP_MBossSignSuggestion1 = commandParameters[5].Value.ToString();
                au.PWP_MBossSignMan1        = commandParameters[6].Value.ToString();
                au.PWP_MBossSignTime1       = commandParameters[7].Value.ToString();
                au.PWP_MBossSignResult1     = commandParameters[8].Value.ToString();
                au.PWP_MPDepSignSuggestion1 = commandParameters[9].Value.ToString();
                au.PWP_MPDepSignMan1        = commandParameters[10].Value.ToString();
                au.PWP_MPDepSignTime1       = commandParameters[11].Value.ToString();
                au.PWP_MPDepSignResult1     = commandParameters[12].Value.ToString();


                return(au);
            }
        }
Beispiel #3
0
    public PWPAudit getAudit()
    {
        PWPAudit au = new PWPAudit();

        au.PWP_MBossSignMan1        = PWP_MBossSignMan1;
        au.PWP_MBossSignResult1     = PWP_MBossSignResult1;
        au.PWP_MBossSignSuggestion1 = PWP_MBossSignSuggestion1;
        au.PWP_MBossSignTime1       = PWP_MBossSignTime1;
        au.PWP_MFDepSignMan1        = PWP_MFDepSignMan1;
        au.PWP_MFDepSignResult1     = PWP_MFDepSignResult1;
        au.PWP_MFDepSignSuggestion1 = PWP_MFDepSignSuggestion1;
        au.PWP_MFDepSignTime1       = PWP_MFDepSignTime1;
        au.PWP_MPDepSignMan1        = PWP_MPDepSignMan1;
        au.PWP_MPDepSignResult1     = PWP_MPDepSignResult1;
        au.PWP_MPDepSignSuggestion1 = PWP_MPDepSignSuggestion1;
        au.PWP_MPDepSignTime1       = PWP_MPDepSignTime1;
        return(au);
    }
Beispiel #4
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Details")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            Button4.Visible         = false;
            Panel3.Visible          = true;
            Guid pmpid = new Guid(e.CommandArgument.ToString());
            Label14.Text = pmpid.ToString();
            if (row.Cells[9].Text == "已建立")
            {
                GridView2.DataSource = wp.Query_WPlanDetail(pmpid);
                GridView2.DataBind();
            }
            else
            {
                GridView2.DataSource = wp.Query_WPlanDetailFlash(pmpid);
                GridView2.DataBind();
            }

            Label10.Text    = "查看";
            Label11.Text    = row.Cells[2].Text;
            Label12.Text    = row.Cells[3].Text;
            Labelweek.Text  = row.Cells[4].Text;
            Panel4.Visible  = false;
            Panel5.Visible  = false;
            Panel6.Visible  = false;
            Panel7.Visible  = false;
            Panel31.Visible = false;
            GridView2.Columns[12].Visible = false;


            GridView2.SelectedIndex = -1;
        }
        if (e.CommandName == "Make")
        {
            TextBox6.Enabled = true;
            TextBox7.Enabled = true;
            Panel31.Visible  = true;
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            if (row.Cells[9].Text == "未建立")
            {
                Label10.Text   = "制定";
                Label11.Text   = row.Cells[2].Text;
                Label12.Text   = row.Cells[3].Text;
                Labelweek.Text = row.Cells[4].Text;
                Panel3.Visible = true;
                Salesid        = new Guid(e.CommandArgument.ToString());

                Label13.Text    = Salesid.ToString();
                Button4.Visible = false;
                TextBox6.Text   = "";
                TextBox7.Text   = "";
                Panel4.Visible  = false;
                Panel5.Visible  = false;
                Panel6.Visible  = false;
                Panel7.Visible  = false;
                int    year     = int.Parse(Label11.Text);
                int    month    = int.Parse(Label12.Text);
                string man      = Session["UserName"].ToString();
                string makedate = DateTime.Now.ToString("yyyy-MM-dd");
                GridView2.Columns[12].Visible = true;
                Guid sid   = new Guid(Label13.Text);
                Guid mwpid = wp.Insert_PWP(sid, year, month, man, makedate, null, null, Convert.ToInt32(Linenum.Text));
                Label14.Text = mwpid.ToString();
                wp.UpdatePlanState(mwpid);
                GridView2.DataSource = wp.Query_WPlanDetail(new Guid(Label14.Text));
                GridView2.DataBind();
                GridView1.DataSource = wp.Query_WPlan(int.Parse(syear.Text), int.Parse(smonth.Text), int.Parse(sweek.Text), sstate.Text, Convert.ToInt32(Linenum.Text));
                GridView1.DataBind();
                GridView2.SelectedIndex = -1;
            }
            else
            {
                Button4.Visible = false;
                Panel3.Visible  = true;
                Guid pwpid = new Guid(row.Cells[1].Text);
                Label14.Text         = pwpid.ToString();
                GridView2.DataSource = wp.Query_WPlanDetail(pwpid);
                GridView2.DataBind();
                Label10.Text   = "查看";
                Label11.Text   = row.Cells[2].Text;
                Label12.Text   = row.Cells[3].Text;
                Labelweek.Text = row.Cells[4].Text;
                Panel4.Visible = false;
                Panel5.Visible = false;
                Panel6.Visible = false;
                Panel7.Visible = false;

                Button4.Visible = false;
                Panel31.Visible = true;
                GridView2.Columns[9].Visible = true;
                GridView2.SelectedIndex      = -1;
            }
        }
        if (e.CommandName == "Audit")
        {
            GridView2.Columns[12].Visible = false;
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            MWPid = new Guid(e.CommandArgument.ToString());

            GridView2.DataSource = wp.Query_WPlanDetail(MWPid);
            GridView2.DataBind();
            GridView1.DataSource = wp.Query_WPlan(int.Parse(syear.Text), int.Parse(smonth.Text), int.Parse(sweek.Text), sstate.Text, Convert.ToInt32(Linenum.Text));
            Panel4.Visible       = false;
            Panel5.Enabled       = false;
            Panel6.Enabled       = false;
            Panel7.Enabled       = false;
            Panel31.Visible      = false;
            Panel32.Visible      = false;
            Panel3.Visible       = false;

            Button4.Visible = false;
            if (Session["UserRole"].ToString().Contains("材料周计划审核生产部"))
            {
                Panel5.Enabled = true;
            }
            if (Session["UserRole"].ToString().Contains("材料周计划审核财务部"))
            {
                Panel6.Enabled = true;
            }
            if (Session["UserRole"].ToString().Contains("材料周计划审核副总"))
            {
                Panel7.Enabled = true;
            }
            Panel5.Visible = true;
            Panel6.Visible = true;
            Panel7.Visible = true;
            year           = int.Parse(row.Cells[2].Text);
            month          = int.Parse(row.Cells[3].Text);
            PWPAudit au = new PWPAudit();
            au          = wp.Query_Audit(MWPid);
            Label1.Text = au.PWP_MPDepSignMan1;
            Label2.Text = au.PWP_MPDepSignTime1;
            if (Label2.Text != "")
            {
                Label2.Text = Convert.ToDateTime(Label2.Text).ToString("yyyy-MM-dd HH:mm");
            }

            TextBox3.Text = au.PWP_MPDepSignSuggestion1;
            Label3.Text   = au.PWP_MPDepSignResult1;
            Label4.Text   = au.PWP_MFDepSignMan1;
            Label5.Text   = au.PWP_MFDepSignTime1;
            if (Label5.Text != "")
            {
                Label5.Text = Convert.ToDateTime(Label5.Text).ToString("yyyy-MM-dd HH:mm");
            }

            Label6.Text   = au.PWP_MFDepSignResult1;
            TextBox4.Text = au.PWP_MFDepSignSuggestion1;
            Label7.Text   = au.PWP_MBossSignMan1;
            Label8.Text   = au.PWP_MBossSignTime1;
            if (Label8.Text != "")
            {
                Label8.Text = Convert.ToDateTime(Label8.Text).ToString("yyyy-MM-dd HH:mm");
            }
            Label9.Text   = au.PWP_MBossSignResult1;
            TextBox5.Text = au.PWP_MBossSignSuggestion1;
            if (Label3.Text == "")
            {
                Label3.Text      = "尚未会签";
                P1.Visible       = true;
                TextBox3.Enabled = true;
            }
            else
            {
                P1.Visible       = false;
                TextBox3.Enabled = false;
            }
            if (Label3.Text == "审核驳回")
            {
                Label3.ForeColor = Color.FromName("#f64a80");
            }
            if (Label3.Text == "审核通过")
            {
                Label3.ForeColor = Color.FromName("#34b2e1");
            }

            if (Label6.Text == "")
            {
                Label6.Text      = "尚未会签";
                P2.Visible       = true;
                TextBox4.Enabled = true;
            }
            else
            {
                P2.Visible       = false;
                TextBox4.Enabled = false;
            }
            if (Label6.Text == "审核驳回")
            {
                Label6.ForeColor = Color.FromName("#f64a80");
            }
            if (Label6.Text == "审核通过")
            {
                Label6.ForeColor = Color.FromName("#34b2e1");
            }
            if (Label9.Text == "")
            {
                Label9.Text      = "尚未会签";
                P3.Visible       = true;
                TextBox5.Enabled = true;
            }
            else
            {
                P3.Visible       = false;
                TextBox5.Enabled = false;
            }
            if (Label9.Text == "审核驳回")
            {
                Label9.ForeColor = Color.FromName("#f64a80");
            }
            if (Label9.Text == "审核通过")
            {
                Label9.ForeColor = Color.FromName("#34b2e1");
            }
        }
    }