Ejemplo n.º 1
0
        protected void btn_submit_Click(object sender, EventArgs e)
        {
            int ID = Convert.ToInt32(Request.QueryString["id"]);

            WebModels.Tbl_ProjectDocument document = WebBLL.Tbl_ProjectDocumentManager.GetTbl_ProjectDocumentById(ID);
            document.ClassName = this.ClassName.SelectedValue;
            document.PD_Type   = this.PD_Type.SelectedValue;
            //if (this.PD_Type.SelectedValue != "新增提资")
            //{
            //    document.ParentID = Convert.ToInt32(this.ParentID.SelectedValue);
            //}
            //else {
            //    document.ParentID = 0;
            //}
            document.PD_Name = this.PD_Name.Value;
            if (FileUpload1.FileName != "")
            {
                document.PD_File = WebCommon.Public.UploadFile(FileUpload1, "ProjectDocument");
            }
            document.PD_FileNo = this.PD_FileNo.Value;
            document.Remark    = this.Remark.Value;
            document.PD_Users  = WebBLL.Tbl_ProjectDesignerManager.GetDataTableByPage(1, 1, "projectid=" + document.ProjectID + " and classname='" + WebBLL.Tbl_UserManager.GetTbl_UserByUserName(WebCommon.Public.GetUserName()).U_Specialty + "'", "").Rows[0]["UserName"].ToString();
            document.Status    = "提资主设审核";
            document.DealUser  = WebCommon.Public.GetUserName();
            int count = WebBLL.Tbl_ProjectDocumentManager.UpdateTbl_ProjectDocument(document);

            if (count > 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('提交成功,请等待主设审核!!');window.external.reload();window.external.close();", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('提交失败!');", true);
            }
        }
Ejemplo n.º 2
0
        public void Bind()
        {
            int ID = Convert.ToInt32(Request.QueryString["id"]);

            WebModels.Tbl_ProjectDocument document = WebBLL.Tbl_ProjectDocumentManager.GetTbl_ProjectDocumentById(ID);
            this.ProjectID.Text  = document.ProjectID.ToString();
            this.ParentID.Text   = document.ParentID.ToString();
            this.ClassName.Text  = document.ClassName;
            this.PD_Type.Text    = document.PD_Type;
            this.PD_Name.Value   = document.PD_Name;
            this.PD_FileNo.Value = document.PD_FileNo;
            this.Remark.Value    = document.Remark;
            this.Status.Text     = document.Status;
            lishitizi.Visible    = false;
        }
Ejemplo n.º 3
0
        protected void btn_submit_Click(object sender, EventArgs e)
        {
            WebModels.Tbl_ProjectDocument document = new WebModels.Tbl_ProjectDocument();
            document.UserName  = WebCommon.Public.GetUserName();
            document.ProjectID = Convert.ToInt32(this.ProjectID.SelectedValue);
            document.ClassName = this.ClassName.SelectedValue;
            document.PD_Type   = this.PD_Type.SelectedValue;
            if (this.PD_Type.SelectedValue != "新增提资")
            {
                document.ParentID = Convert.ToInt32(this.ParentID.SelectedValue);
            }
            else
            {
                document.ParentID = 0;
            }
            document.PD_Name   = this.PD_Name.Value;
            document.PD_File   = WebCommon.Public.UploadFile(FileUpload1, "ProjectDocument");
            document.PD_FileNo = this.PD_FileNo.Value;
            document.Remark    = this.Remark.Value;
            document.Status    = this.Status.SelectedValue;
            document.DealUser  = WebCommon.Public.GetUserName();
            //查询提资主设
            string MainDeigner = "";

            try
            {
                MainDeigner = WebBLL.Tbl_ProjectDesignerManager.GetDataTableByPage(1, 1, "projectid=" + document.ProjectID + " and classname='" + ClassNameFrom.Text + "'", "").Rows[0]["UserName"].ToString();
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('尚未发现该项目中你的主设人是谁因此不能提资!');", true);
                return;
            }
            document.PD_Users = MainDeigner;
            int count = WebBLL.Tbl_ProjectDocumentManager.AddTbl_ProjectDocument(document);

            if (count > 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('提交成功,请等待主设审核!');window.external.reload();window.external.close();", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('提交失败!');", true);
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //删除
                if (Request.QueryString["limit"] == "del")
                {
                    string ids   = Request.QueryString["id"].ToString();
                    int    count = WebCommon.Public.DataTableDel("tbl_ProjectDocument", "id in(" + ids + ")");
                    if (count > 0)
                    {
                        WebCommon.Script.Redirect(WebCommon.Public.GetFromUrl());
                    }
                    else
                    {
                        WebCommon.Script.AlertAndGoBack("删除失败!");
                    }
                }
                //审核
                if (Request.QueryString["type"] == "通过")
                {
                    //插入数据
                    int id = WebCommon.Public.ToInt(Request.QueryString["id"]);
                    WebModels.Tbl_ProjectDocument document = WebBLL.Tbl_ProjectDocumentManager.GetTbl_ProjectDocumentById(id);
                    //查询受资主设
                    switch (document.Status)
                    {
                    case "提资主设审核":
                        document.Status   = "受资主设审核";
                        document.PD_Users = WebBLL.Tbl_ProjectDesignerManager.GetDataTableByPage(1, 1, "projectid=" + document.ProjectID + " and classname='" + document.ClassName + "'", "").Rows[0]["UserName"].ToString();
                        break;

                    case "受资主设审核":
                        document.Status = "发送设计人";
                        break;
                    }
                    WebBLL.Tbl_ProjectDocumentManager.UpdateTbl_ProjectDocument(document);
                    WebCommon.Script.AlertAndRedirect("操作成功", WebCommon.Public.GetFromUrl());
                }

                if (Request.QueryString["type"] == "不通过")
                {
                    //插入数据
                    int id = WebCommon.Public.ToInt(Request.QueryString["id"]);
                    WebModels.Tbl_ProjectDocument document = WebBLL.Tbl_ProjectDocumentManager.GetTbl_ProjectDocumentById(id);
                    document.PD_Users = document.UserName;
                    document.Status   = "异议返回";
                    WebBLL.Tbl_ProjectDocumentManager.UpdateTbl_ProjectDocument(document);
                    WebCommon.Script.AlertAndRedirect("操作成功", WebCommon.Public.GetFromUrl());
                }

                //发送设计师
                string pddesigner = WebCommon.Public.ToString(Request.QueryString["Designer"]);
                int    pdid       = WebCommon.Public.ToInt(Request.QueryString["ID"]);
                if (pddesigner != "")
                {
                    WebModels.Tbl_ProjectDocument document = WebBLL.Tbl_ProjectDocumentManager.GetTbl_ProjectDocumentById(pdid);
                    document.PD_Users = pddesigner;
                    document.Status   = "已存档";
                    WebBLL.Tbl_ProjectDocumentManager.UpdateTbl_ProjectDocument(document);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('发送成功');", true);
                }

                //绑定设计师
                Designer.DataSource     = WebBLL.Tbl_UserManager.GetDataTableByPage(200, 1, "U_DesignLimit like '%设计人%'", "username desc");
                Designer.DataTextField  = "UserName";
                Designer.DataValueField = "UserName";
                Designer.DataBind();
                Designer.Items.Insert(0, new ListItem("选择设计师", ""));

                //绑定列表
                Bind();
            }
        }