Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //项目ID
                ProjectID.DataSource     = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(56);
                ProjectID.DataTextField  = "ClassName";
                ProjectID.DataValueField = "ClassName";
                ProjectID.DataBind();
                ProjectID.Items.Insert(0, new ListItem("选择项目类别", ""));

                //专业
                ClassName.DataSource     = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(15);
                ClassName.DataTextField  = "ClassName";
                ClassName.DataValueField = "ClassName";
                ClassName.DataBind();
                ClassName.Items.Insert(0, new ListItem("选择专业", ""));

                //遍历绑定人员列表
                //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DesignManager);
                //DesignManager.Items.Insert(0, new ListItem("选择设总", ""));
                ////遍历绑定人员列表
                //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DesignMain);
                //DesignMain.Items.Insert(0, new ListItem("选择主设", ""));
                //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DT_SheJiRen);
                //DT_SheJiRen.Items.Insert(0, new ListItem("选择审计人", ""));
                //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DT_JiaoDuiRen);
                //DT_JiaoDuiRen.Items.Insert(0, new ListItem("选择校对人", ""));
                //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DT_ShenHeRen);
                //DT_ShenHeRen.Items.Insert(0, new ListItem("选择审核人", ""));
                //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DT_ShenDingRen);
                //DT_ShenDingRen.Items.Insert(0, new ListItem("选择审定人", ""));
                //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DT_HeZhunRen);
                //DT_HeZhunRen.Items.Insert(0, new ListItem("选择核准人", ""));
                ////卷册
                //ClassName3.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(60);
                //ClassName3.DataTextField = "ClassName";
                //ClassName3.DataValueField = "ClassName";
                //ClassName3.DataBind();
                //ClassName3.Items.Insert(0, new ListItem("选择卷册", ""));

                //删除
                if (Request.QueryString["limit"] == "del")
                {
                    int ids   = Convert.ToInt32(Request.QueryString["id"].ToString());
                    int count = WebCommon.Public.DataTableDel("Tbl_DesignTask", "id in(" + ids + ")");
                    if (count > 0)
                    {
                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('删除成功!');", true);
                    }
                    else
                    {
                        WebCommon.Script.AlertAndGoBack("删除失败!");
                    }
                }
                //如果是通过任务明细连接过来
                int projectid = WebCommon.Public.ToInt(Request.QueryString["ProjectID"]);
                if (projectid > 0)
                {
                    ProjectName.SelectedValue = projectid.ToString();
                    WebModels.Tbl_Project project = WebBLL.Tbl_ProjectManager.GetTbl_ProjectById(Convert.ToInt32(Request.QueryString["ProjectID"]));
                    ProjectName.Items.Insert(0, new ListItem(project.ProjectName, Request.QueryString["ProjectID"]));
                    ProjectID.SelectedValue = project.ProjectTypes;
                    ProjectNo.Value         = project.ProjectNo;
                    ProjectName.Enabled     = false;
                    ProjectID.Enabled       = false;
                    ProjectNo.Attributes.Add("readonly", "readonly");

                    //设总默认
                    DesignManager.Items.Insert(0, new ListItem(project.ProjectMainDesigner, project.ProjectMainDesigner));
                    DesignManager.Enabled = false;

                    //主设默认
                    //DesignMain.Items.Insert(0, new ListItem(WebCommon.Public.GetUserName(), WebCommon.Public.GetUserName()));
                    //DesignMain.Enabled = false;
                    DesignMain.DataSource     = WebBLL.Tbl_ProjectDesignerManager.GetDataTableByPage(50, 1, "projectid=" + ProjectName.SelectedValue + " and username in (select distinct(designmain) from tbl_designtask where status='任务审批' and projectid=" + project.ID.ToString() + ")", "");
                    DesignMain.DataTextField  = "UserName";
                    DesignMain.DataValueField = "ClassName";
                    DesignMain.DataBind();
                    DesignMain.Items.Insert(0, new ListItem("选择主设", ""));

                    //专业默认
                    //string classname = WebBLL.Tbl_UserManager.GetTbl_UserByUserName(WebCommon.Public.GetUserName()).U_Specialty;
                    //if (WebCommon.Public.ToString(Request.QueryString["ClassName"]) != "") classname = Request.QueryString["ClassName"];
                    //ClassName.Items.Insert(0, new ListItem(classname, classname));
                    ClassName.Enabled = false;

                    //卷默认
                    //ClassName1.DataSource = WebBLL.Tbl_ClassManager.GetDataTableByPage(10, 1, "parentid=(select top 1 id from tbl_class where classname='" + classname + "')", "id desc");
                    //ClassName1.DataTextField = "ClassName";
                    //ClassName1.DataValueField = "ID";
                    //ClassName1.DataBind();
                    ClassName1.Items.Insert(0, new ListItem("选择卷", ""));
                    ClassName1.Enabled = false;

                    //绑定当前任务
                    BindList();
                }
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int taskid = WebCommon.Public.ToInt(Request.QueryString["TaskID"]);
                //任务评级
                string pingji = WebCommon.Public.ToString(Request.QueryString["pingji"]);
                if (pingji != "")
                {
                    //初始化任务表
                    WebCommon.Public.DataTableUpdate("tbl_designtask", "papernum3=" + pingji, "id=" + taskid.ToString());
                    WebCommon.Script.Alert("评级成功");
                }

                //任务重置
                int chongzhi = WebCommon.Public.ToInt(Request.QueryString["chongzhi"]);
                if (chongzhi == 1)
                {
                    //初始化任务表
                    WebCommon.Public.DataTableUpdate("tbl_designtask", "status='等待设计',statuslast='',papernum1=0,papernum2=0", "id=" + taskid.ToString());
                    //删除校审表记录
                    WebCommon.Public.DataTableDel("tbl_designcorrect", "designtaskid=" + taskid.ToString(), true);
                    WebCommon.Script.Alert("重置成功");
                }

                //项目ID
                ProjectID.DataSource     = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(56);
                ProjectID.DataTextField  = "ClassName";
                ProjectID.DataValueField = "ClassName";
                ProjectID.DataBind();
                ProjectID.Items.Insert(0, new ListItem("选择项目类别", ""));

                //专业
                string classname = WebCommon.Public.ToString(Server.UrlDecode(Request.QueryString["ClassName1"]));
                ClassName.Items.Insert(0, new ListItem(classname, classname));
                ClassName.Enabled = false;

                //如果是通过任务明细连接过来
                int projectid = WebCommon.Public.ToInt(Request.QueryString["ProjectID"]);
                if (projectid > 0)
                {
                    ProjectName.SelectedValue = projectid.ToString();
                    WebModels.Tbl_Project project = WebBLL.Tbl_ProjectManager.GetTbl_ProjectById(Convert.ToInt32(Request.QueryString["ProjectID"]));
                    ProjectName.Items.Insert(0, new ListItem(project.ProjectName, Request.QueryString["ProjectID"]));
                    ProjectID.SelectedValue = project.ProjectTypes;
                    ProjectNo.Value         = project.ProjectNo;
                    ProjectName.Enabled     = false;
                    ProjectID.Enabled       = false;
                    ProjectNo.Attributes.Add("readonly", "readonly");

                    //设总默认
                    DesignManager.Items.Insert(0, new ListItem(project.ProjectMainDesigner, project.ProjectMainDesigner));
                    DesignManager.Enabled = false;

                    //主设默认
                    //DesignMain.Items.Insert(0, new ListItem(WebCommon.Public.GetUserName(), WebCommon.Public.GetUserName()));
                    //DesignMain.Enabled = false;
                    DesignMain.DataSource     = WebBLL.Tbl_ProjectDesignerManager.GetDataTableByPage(10, 1, "projectid=" + ProjectName.SelectedValue + " and ClassName='" + classname + "'", "");
                    DesignMain.DataTextField  = "UserName";
                    DesignMain.DataValueField = "ClassName";
                    DesignMain.DataBind();
                    //DesignMain.Items.Insert(0, new ListItem("选择主设", ""));

                    //专业默认
                    //string classname = WebBLL.Tbl_UserManager.GetTbl_UserByUserName(WebCommon.Public.GetUserName()).U_Specialty;
                    //if (WebCommon.Public.ToString(Request.QueryString["ClassName"]) != "") classname = Request.QueryString["ClassName"];
                    //ClassName.Items.Insert(0, new ListItem(classname, classname));

                    //卷默认
                    //ClassName1.DataSource = WebBLL.Tbl_ClassManager.GetDataTableByPage(10, 1, "parentid=(select top 1 id from tbl_class where classname='" + classname + "')", "id desc");
                    //ClassName1.DataTextField = "ClassName";
                    //ClassName1.DataValueField = "ID";
                    //ClassName1.DataBind();
                    ClassName1.Items.Insert(0, new ListItem("选择卷", ""));
                    ClassName1.Enabled = false;

                    //绑定当前任务
                    BindList();
                }
            }
        }