예제 #1
0
    protected void grdvw_List_RowEditing(object sender, GridViewEditEventArgs e)
    {
        strSelectedId     = grdvw_List.Rows[e.NewEditIndex].Cells[1].Text;
        txt_ItemName.Text = grdvw_List.Rows[e.NewEditIndex].Cells[2].Text;
        if (grdvw_List.Rows[e.NewEditIndex].Cells[2].Text.Trim() != " ")
        {
            txt_AccessTime.Text = grdvw_List.Rows[e.NewEditIndex].Cells[4].Text;
        }
        else
        {
            txt_AccessTime.Text = "";
        }
        txt_person0.Text = grdvw_List.Rows[e.NewEditIndex].Cells[3].Text;

        txt_ItemName.ReadOnly = true;
        txt_person0.ReadOnly  = true;

        //备注绑定
        //项目接收备注显示
        string  remarkstr  = "select CreateDate 备注时间,bz 备注及意见,userid 用户名 from t_Y_Detail inner join t_Y_FlowInfo on t_Y_Detail.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_Detail.statusid where t_Y_Detail.itemid='" + strSelectedId + "' and t_Y_Detail.statusid='1' order by t_Y_Detail.id";
        DataSet ds_Remark1 = new MyDataOp(remarkstr).CreateDataSet();
        string  strtemp    = "select Name,UserID from t_R_UserInfo";
        DataSet ds_User    = new MyDataOp(strtemp).CreateDataSet();

        foreach (DataRow dr in ds_Remark1.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
            }
        }
        GridView1.DataSource = ds_Remark1;
        GridView1.DataBind();
        string  remarkstr2 = "select  CreateDate 备注时间,bz 备注及意见,userid 用户名 from t_Y_Detail inner join t_Y_FlowInfo on t_Y_Detail.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_Detail.statusid where t_Y_Detail.itemid='" + strSelectedId + "' and t_Y_Detail.statusid='2' order by t_Y_Detail.id";
        DataSet ds_Remark2 = new MyDataOp(remarkstr2).CreateDataSet();

        foreach (DataRow dr in ds_Remark2.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
            }
        }
        GridView2.DataSource = ds_Remark2;
        GridView2.DataBind();
        string  remarkstr3 = "select  CreateDate 备注时间,bz 备注及意见,userid 用户名 from t_Y_Detail inner join t_Y_FlowInfo on t_Y_Detail.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_Detail.statusid where t_Y_Detail.itemid='" + strSelectedId + "' and t_Y_Detail.statusid='3' order by t_Y_Detail.id";
        DataSet ds_Remark3 = new MyDataOp(remarkstr3).CreateDataSet();

        foreach (DataRow dr in ds_Remark3.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
            }
        }
        GridView3.DataSource = ds_Remark3;
        GridView3.DataBind();
        string  remarkstr4 = "select  CreateDate 备注时间,bz 备注及意见,userid 用户名 from t_Y_Detail inner join t_Y_FlowInfo on t_Y_Detail.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_Detail.statusid where t_Y_Detail.itemid='" + strSelectedId + "' and t_Y_Detail.statusid='4' order by t_Y_Detail.id";
        DataSet ds_Remark4 = new MyDataOp(remarkstr4).CreateDataSet();

        foreach (DataRow dr in ds_Remark4.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
            }
        }
        GridView4.DataSource = ds_Remark4;
        GridView4.DataBind();
        string  remarkstr5 = "select CreateDate 备注时间,bz 备注及意见,userid 用户名 from t_Y_Detail inner join t_Y_FlowInfo on t_Y_Detail.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_Detail.statusid where t_Y_Detail.itemid='" + strSelectedId + "' and t_Y_Detail.statusid='5' order by t_Y_Detail.id";
        DataSet ds_Remark5 = new MyDataOp(remarkstr5).CreateDataSet();

        foreach (DataRow dr in ds_Remark5.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
            }
        }
        GridView5.DataSource = ds_Remark5;
        GridView5.DataBind();
        string  remarkstr6 = "select CreateDate 备注时间,bz 备注及意见,userid 用户名 from t_Y_Detail inner join t_Y_FlowInfo on t_Y_Detail.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_Detail.statusid where t_Y_Detail.itemid='" + strSelectedId + "' and t_Y_Detail.statusid='6' order by t_Y_Detail.id";
        DataSet ds_Remark6 = new MyDataOp(remarkstr6).CreateDataSet();

        foreach (DataRow dr in ds_Remark6.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
            }
        }
        GridView6.DataSource = ds_Remark6;
        GridView6.DataBind();
        string  remarkstr7 = "select CreateDate 备注时间,bz 备注及意见,userid 用户名 from t_Y_Detail inner join t_Y_FlowInfo on t_Y_Detail.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_Detail.statusid where t_Y_Detail.itemid='" + strSelectedId + "' and t_Y_Detail.statusid='7' order by t_Y_Detail.id";
        DataSet ds_Remark7 = new MyDataOp(remarkstr7).CreateDataSet();

        foreach (DataRow dr in ds_Remark7.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
            }
        }
        GridView7.DataSource = ds_Remark7;
        GridView7.DataBind();
        string  remarkstr8 = "select  CreateDate 备注时间,bz 备注及意见,userid 用户名 from t_Y_Detail inner join t_Y_FlowInfo on t_Y_Detail.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_Detail.statusid where t_Y_Detail.itemid='" + strSelectedId + "' and t_Y_Detail.statusid='8' order by t_Y_Detail.id";
        DataSet ds_Remark8 = new MyDataOp(remarkstr8).CreateDataSet();

        foreach (DataRow dr in ds_Remark8.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
            }
        }
        GridView8.DataSource = ds_Remark8;
        GridView8.DataBind();
        //备注绑定
        //有回退的,则显示回退备注,非回退,不显示
        string backremarkstr = "select createdate 备注时间,t_Y_BackInfo.remark 备注及意见,userid 用户名 from t_Y_BackInfo inner join t_Y_FlowInfo on t_Y_BackInfo.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_BackInfo.functionid where t_Y_BackInfo.itemid='" + strSelectedId + "' and t_Y_BackInfo.functionid='10' order by t_Y_BackInfo.id";

        // string backremarkstr = "select * from t_Y_BackInfo where itemid='" + strSelectedId + "' and functionid='2'";
        DataSet ds_Remark_back = new MyDataOp(backremarkstr).CreateDataSet();

        foreach (DataRow dr in ds_Remark_back.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
            }
        }
        GridView_back.DataSource = ds_Remark_back;
        GridView_back.DataBind();
        //回退的数据编辑,显示前面的备注信息,只读
        string  remarkstr_now = "select ItemName 项目类型, name 阶段,CreateDate 备注时间,bz 备注及意见,userid 用户名,flag,t_Y_Detail.id from t_Y_Detail inner join t_Y_FlowInfo on t_Y_Detail.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_Detail.statusid where t_Y_Detail.itemid='" + strSelectedId + "' and t_Y_Detail.statusid='9' order by t_Y_Detail.id";
        DataSet ds_Remark_now = new MyDataOp(remarkstr_now).CreateDataSet();

        foreach (DataRow dr in ds_Remark_now.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
            }
        }
        GridView_now.DataSource = ds_Remark_now;
        GridView_now.DataBind();
        DataRow[] dr_remark = ds_Remark_now.Tables[0].Select("flag=0");
        if (dr_remark.Length > 0)
        {
            txt_Remark_now.Text = dr_remark[0][3].ToString();
            SelectedId          = dr_remark[0][6].ToString();
        }
        if (ds_Remark_back.Tables[0].Rows.Count > 0)
        {
            Panel_back.Visible = true;
        }
        else
        {
            Panel_back.Visible = false;
        }
        ds_Remark1.Dispose();
        ds_Remark2.Dispose();
        ds_Remark3.Dispose();
        ds_Remark4.Dispose();
        ds_Remark5.Dispose();
        ds_Remark6.Dispose();
        ds_Remark7.Dispose();
        ds_Remark8.Dispose();
        // ds_Remark9.Dispose();
        //ds_Remark10.Dispose();
        //ds_Remark11.Dispose();
        //ds_Remark12.Dispose();
        //ds_Remark13.Dispose();
        //ds_Remark14.Dispose();
        ds_Remark_back.Dispose();
        ds_Remark_now.Dispose();



        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "showAddEdit();", true);
    }
예제 #2
0
    protected void grdvw_List_RowEditing(object sender, GridViewEditEventArgs e)
    {
        lbl_Type.Text = "编辑";
        initial();
        //cb_if.Checked = false;
        strSelectedId = grdvw_List.Rows[e.NewEditIndex].Cells[1].Text;
        drop_ItemName.SelectedValue = grdvw_List.Rows[e.NewEditIndex].Cells[3].Text;

        txt_wtdw.Text = grdvw_List.Rows[e.NewEditIndex].Cells[2].Text;
        txt_man.Text  = grdvw_List.Rows[e.NewEditIndex].Cells[4].Text;
        txt_tel.Text  = grdvw_List.Rows[e.NewEditIndex].Cells[5].Text;
        //if (grdvw_List.Rows[e.NewEditIndex].Cells[10].Text.Trim() != " ")
        //    if (grdvw_List.Rows[e.NewEditIndex].Cells[10].Text.Trim() == "1")
        //        cb_if.Checked = true;
        //    else
        //        cb_if.Checked = false;
        //else
        //    cb_if.Checked = false;
        //备注绑定ItemName 项目类型, name 阶段,
        string  remarkstr  = "select wtdw 委托单位,ItemName 项目类型, name 阶段, CreateDate 备注时间,bz 备注及意见,userid 用户名,flag,t_Y_Detail.id from t_Y_Detail inner join t_Y_FlowInfo on t_Y_Detail.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_Detail.statusid where t_Y_Detail.itemid='" + strSelectedId + "' and t_Y_Detail.statusid='1' order by t_Y_Detail.id ";
        DataSet ds_Remark1 = new MyDataOp(remarkstr).CreateDataSet();
        string  strtemp    = "select Name,UserID from t_R_UserInfo";
        DataSet ds_User    = new MyDataOp(strtemp).CreateDataSet();

        foreach (DataRow dr in ds_Remark1.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
            }
        }
        GridView1.DataSource = ds_Remark1;
        GridView1.DataBind();

        DataRow[] dr_remark = ds_Remark1.Tables[0].Select("flag=0");
        if (dr_remark.Length > 0)
        {
            txt_Remark.Text = dr_remark[0][4].ToString();
            SelectedId      = dr_remark[0][7].ToString();
        }
        ds_Remark1.Dispose();
        //有回退的,则显示回退备注,非回退,不显示
        // string backremarkstr = "select * from t_Y_BackInfo where itemid='" + strSelectedId + "' and functionid='1'";
        string backremarkstr = "select ItemName 项目类型, name 阶段,createdate 备注时间,t_Y_BackInfo.remark 备注及意见,userid 用户名 from t_Y_BackInfo inner join t_Y_FlowInfo on t_Y_BackInfo.itemid=t_Y_FlowInfo.id inner join t_Y_FlowDetail on t_Y_FlowDetail.id= t_Y_BackInfo.functionid where t_Y_BackInfo.itemid='" + strSelectedId + "' and t_Y_BackInfo.functionid='2' order by t_Y_BackInfo.id";

        DataSet ds_Remark_back = new MyDataOp(backremarkstr).CreateDataSet();

        foreach (DataRow dr in ds_Remark_back.Tables[0].Rows)
        {
            foreach (DataRow drr in ds_User.Tables[0].Rows)
            {
                if (dr["用户名"].ToString() == drr["UserID"].ToString())
                {
                    dr["用户名"] = drr["Name"].ToString();
                }
                //if (dr["ReportProofUserID"].ToString() == drr["UserID"].ToString())
                //    dr["ReportProofUserID"] = drr["Name"].ToString();
                //if (dr["ReportSignUserID"].ToString() == drr["UserID"].ToString())
                //    dr["ReportSignUserID"] = drr["Name"].ToString();
            }
        }
        GridView_back.DataSource = ds_Remark_back;
        GridView_back.DataBind();

        //回退的数据编辑,显示前面的备注信息,只读
        if (ds_Remark_back.Tables[0].Rows.Count > 0)
        {
            Panel_back.Visible = true;
        }
        else
        {
            Panel_back.Visible = false;
        }

        ds_Remark_back.Dispose();


        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "showAddEdit();", true);
    }