Exemplo n.º 1
0
        protected void btnDelete_Command(object sender, CommandEventArgs e)
        {
            string Id = e.CommandArgument.ToString();

            WX.PRO.Project.MODEL model = WX.PRO.Project.GetModel("select * from PRO_Projects where ID=" + Id);
            if (e.CommandName == "del")
            {
                int row = ULCode.QDA.XSql.Execute("DELETE FROM PRO_Projects WHERE ID=" + Id);
                ULCode.QDA.XSql.Execute("DELETE FROM PRO_Process WHERE ProjID=" + Id);
                if (row > 0)
                {
                    WX.PRO.Log.AddLog(3, Convert.ToInt32(Id), model.ProjectName.ToString() + "-删除项目。", Request.UserHostAddress);
                }
            }
            else if (e.CommandName == "qidong")
            {
                model.State.value = 4;
                model.Update();
                WX.PRO.State.MODEL statemodel = WX.PRO.State.GetModel("select * from PRO_State where ProjID=" + model.ID.ToString());
                statemodel.State.value     = 1;
                statemodel.ProcID.value    = 1;
                statemodel.Starttime.value = DateTime.Now;
                statemodel.Update();
                WX.PRO.Process.SetTime(Convert.ToDateTime(statemodel.Starttime.value), Convert.ToInt32(statemodel.ProjID.value), 1);
                WX.PRO.Log.AddLog(2, Convert.ToInt32(Id), model.ProjectName.ToString() + "-启动。", Request.UserHostAddress);
                WX.PRO.Log.AddLog(5, Convert.ToInt32(Id), model.ProjectName.ToString() + "-第1步开始。", Request.UserHostAddress);
            }
            InitComponent(false);
        }
Exemplo n.º 2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     WX.PRO.Project.MODEL model = WX.PRO.Project.GetModel("select * from PRO_Projects where ID=" + WX.Request.rProjectId);
     model.Manage.value  = WX.Main.CurUser.UserID;
     model.Opinion.value = ui_Opinion.Text.Trim();
     model.Stime.value   = DateTime.Now;
     if (((Button)sender).ID == "Button1")
     {
         model.ProjectName.value = ui_Name.Text.Trim();
         model.Days.value        = ui_days.Text.Trim();
         //model.Fee.value = ui_fee.Text.Trim();
         string[] userarry = ui_Persons.Value.Trim().Split(',');
         model.Persons.value = ui_Persons.Value != null ? userarry.Length : 0;
         model.State.value   = 2;
         //4.业务处理过程
         model.Update();
         if (ui_Persons.Value != null)
         {
             ULCode.QDA.XSql.Execute("delete from PRO_User where type=1 and pid=" + model.ID.ToString());
             for (int i = 0; i < userarry.Length; i++)
             {
                 WX.PRO.User.MODEL usermodel = WX.PRO.User.NewDataModel();
                 usermodel.PID.value    = model.ID.ToString();
                 usermodel.type.value   = 1;
                 usermodel.UserID.value = userarry[i];
                 usermodel.Insert();
             }
         }
         ULCode.QDA.XSql.Execute("delete from PRO_State where ProjID=" + model.ID.ToString());
         WX.PRO.State.MODEL statemodel = WX.PRO.State.NewDataModel();
         statemodel.ProjID.value = model.ID.value;
         if (ui_manage.Value != "")
         {
             statemodel.Manage.value = ui_manage.Value;
         }
         statemodel.Fee.value         = ui_fee.Text.Trim();
         statemodel.Percnt.value      = 0;
         statemodel.Percnttime.value  = 0;
         statemodel.State.value       = 0;
         statemodel.YJStarttime.value = ui_yjstarttime.Text;
         statemodel.Insert();
         WX.PRO.Process.SetTime(Convert.ToDateTime(statemodel.YJStarttime.ToString()), Convert.ToInt32(statemodel.ProjID.value), 1);
         //5.登记日志
         WX.PRO.Log.AddLog(1, Convert.ToInt32(model.ID.value), "审核通过。审批意见:" + model.Opinion.ToString(), Request.UserHostAddress);
     }
     else
     {
         model.State.value = 3;
         model.Update();
         WX.PRO.Log.AddLog(1, Convert.ToInt32(model.ID.ToString()), model.ProjectName.ToString() + "的申请被退回。原因:" + model.Opinion.ToString(), Request.UserHostAddress);
     }
     //6.返回处理结果或返回其它页面。
     Response.Redirect("Proj_ProjectManage.aspx");
 }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         WX.PRO.Project.MODEL model = WX.PRO.Project.GetModel("select * from PRO_Projects where ID=" + WX.Request.rProjectId);
         if (model != null)
         {
             li_name.Text = model.ProjectName.ToString();
             ui_Name.Text = model.ProjectName.ToString();
             li_days.Text = model.Days.ToString();
             ui_days.Text = model.Days.ToString();
             if (Convert.ToInt32(model.Persons.ToString()) > 0)
             {
                 ULCode.QDA.XDataTable xdt = ULCode.QDA.XSql.GetXDataTable("select pu.UserID,te.RealName from PRO_User pu left join TU_Users te on pu.UserID=te.UserID where pu.type=1 and pid=" + model.ID.ToString());
                 li_persons.Text  = xdt.ToColValueList(",", 1);
                 ui_Persons.Value = xdt.ToColValueList(",", 0);
                 liu_Persons.Text = xdt.ToColValueList(",", 1);
             }
             li_fee.Text     = model.Fee.ToString();
             ui_fee.Text     = model.Fee.ToString();
             li_content.Text = model.Content.ToString();
             li_Imagine.Text = model.Imagine.ToString();
             li_state.Text   = WX.PRO.Project.statearray[Convert.ToInt32(model.State.ToString())];
             if (model.Annex.ToString() != "")
             {
                 li_annex.Text = "<a href='" + model.Annex.ToString() + "'>" + model.Annex.ToString() + "</a>";
             }
             if (model.State.ToString() == "1" || model.State.ToString() == "0")
             {
                 tr1.Visible       = false;
                 tr2.Visible       = false;
                 checkdata.Visible = model.State.ToString() != "0";
             }
             else
             {
                 WX.PRO.State.MODEL statemodel = WX.PRO.State.GetModel("select * from PRO_State where ProjID=" + model.ID.ToString());
                 if (statemodel.ProcID.ToString() != "" && statemodel.ProcID.ToString() != "0")
                 {
                     //WX.PRO.Process.MODEL procmodel = WX.PRO.Process.GetModel("select top 1 * from PRO_Process where ProjID=" + statemodel.ProjID.ToString() + " and NO="+statemodel.ProcID.ToString());
                     hivalue = statemodel.ProcID.ToString();
                 }
                 li_projmanage.Text   = WX.CommonUtils.GetRealNameListByUserIdList(statemodel.Manage.ToString());
                 li_checkfee.Text     = statemodel.Fee.ToString();
                 li_checkmanage.Text  = WX.CommonUtils.GetRealNameListByUserIdList(model.Manage.ToString());
                 li_checkopinion.Text = model.Opinion.ToString();
                 li_checktime.Text    = Convert.ToDateTime(model.Stime.value).ToString("yyyy-MM-dd HH:mm:ss");
                 checkdata.Visible    = false;
             }
         }
         ReBind();
     }
 }
        protected void btnDelete_Command(object sender, CommandEventArgs e)
        {
            string Id = e.CommandArgument.ToString();

            WX.PRO.Project.MODEL model = WX.PRO.Project.GetModel("select * from PRO_Projects where ID=" + Id);
            int row = ULCode.QDA.XSql.Execute("DELETE FROM PRO_Projects WHERE ID=" + Id);

            ULCode.QDA.XSql.Execute("DELETE FROM PRO_Process WHERE ProjID=" + Id);
            if (row > 0)
            {
                WX.PRO.Log.AddLog(3, Convert.ToInt32(Id), model.ProjectName.ToString() + "-删除项目。", Request.UserHostAddress);
                InitComponent(false);
            }
        }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (WX.Request.rProjectId != 0)
         {
             WX.PRO.Project.MODEL model = WX.PRO.Project.GetModel("select * from PRO_Projects where ID=" + WX.Request.rProjectId);
             if (model != null)
             {
                 Literal1.Text = model.ProjectName.ToString();
                 Literal2.Text = model.ProjectName.ToString();
             }
             ReBind();
         }
     }
 }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //1.验证当前用户页面权限
     if (!this.Master.A_Edit)
     {
         Response.Write("你没有权限访问此功能!");
         Response.End();
         return;
     }
     if (!IsPostBack)
     {
         if (Request["id"] != null)
         {
             WX.PRO.Project.MODEL model = WX.PRO.Project.GetModel("select * from PRO_Projects where ID=" + Request["id"]);
             if (model != null)
             {
                 ui_Name.Text = model.ProjectName.ToString();
                 ui_days.Text = model.Days.ToString();
                 if (Convert.ToInt32(model.Persons.ToString()) > 0)
                 {
                     ULCode.QDA.XDataTable xdt = ULCode.QDA.XSql.GetXDataTable("select pu.UserID,te.RealName from PRO_User pu left join TU_Users te on pu.UserID=te.UserID where pu.type=1 and pid=" + model.ID.ToString());
                     ui_Persons.Value = xdt.ToColValueList(",", 0);
                     li_Persons.Text  = xdt.ToColValueList(",", 1);
                 }
                 //ui_Persons.Value = model.Persons.ToString();
                 ui_fee.Text      = model.Fee.ToString();
                 ui_content.Value = model.Content.ToString();
                 ui_Imagine.Text  = model.Imagine.ToString();
                 if (model.Annex.ToString() != "")
                 {
                     li_annex.Text = "<a href='" + model.Annex.ToString() + "'>" + model.Annex.ToString() + "</a> <br/>";
                 }
                 if (ULCode.QDA.XSql.GetDataTable("select ID from PRO_Process where ProjID=" + model.ID.ToString()).Rows.Count > 0)
                 {
                     Button2.Visible = true;
                 }
             }
         }
     }
 }
Exemplo n.º 7
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //1.验证当前用户页面权限
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            //2.取得用户变量
            WX.PRO.Project.MODEL model = WX.PRO.Project.NewDataModel();
            if (Request["id"] != null)
            {
                model = WX.PRO.Project.GetModel("select * from PRO_Projects where ID=" + Request["id"]);
            }
            model.ProjectName.value = ui_Name.Text.Trim();
            model.Days.value        = ui_days.Text.Trim();
            model.Fee.value         = ui_fee.Text.Trim();
            model.Content.value     = ui_content.Value.Trim();
            string[] userarry = ui_Persons.Value.Trim().Split(',');
            //4.业务处理过程
            model.Persons.value = ui_Persons.Value != null ? userarry.Length : 0;
            string fileDir = "";

            if (FileUpload1.HasFile)
            {
                string fileExtension = System.IO.Path.GetExtension(FileUpload1.FileName).ToLower();
                if (!".rar.zip.doc.docx.ppt".Contains(fileExtension))
                {
                    ULCode.Debug.Alert(this, "照片格式必须为.rar.zip.doc.docx.ppt!");
                    return;
                }
                fileDir = "/UploadFiles/Proj/" + model.ProjectName.ToString() + DateTime.Now.ToString("-yyyyMMddHHmmss") + fileExtension;
                try
                {
                    FileUpload1.SaveAs(Server.MapPath(fileDir));
                }
                catch
                {
                    fileDir = "";
                }
            }
            if (fileDir != "")
            {
                model.Annex.value = fileDir;
            }
            model.Imagine.value = ui_Imagine.Text.Trim();
            model.State.value   = ((Button)sender).ID == "Button1" ? 0 : 1;
            int    pid    = 0;
            string logstr = model.ProjectName.ToString() + "-添加";

            if (Request["id"] != null)
            {
                pid    = Convert.ToInt32(model.ID.value);
                logstr = model.ProjectName.ToString() + "-修改";
                model.Update();
            }
            else
            {
                model.UserID.value = WX.Main.CurUser.UserID;
                pid = model.Insert(true);
            }
            if (ui_Persons.Value != null)
            {
                ULCode.QDA.XSql.Execute("delete from PRO_User where type=1 and pid=" + pid);
                for (int i = 0; i < userarry.Length; i++)
                {
                    WX.PRO.User.MODEL usermodel = WX.PRO.User.NewDataModel();
                    usermodel.PID.value    = pid;
                    usermodel.type.value   = 1;
                    usermodel.UserID.value = userarry[i];
                    usermodel.Insert();
                }
            }
            //5.登记日志
            WX.PRO.Log.AddLog(0, pid, logstr + (((Button)sender).ID == "Button1" ? "" : "并申请"), Request.UserHostAddress);
            //6.返回处理结果或返回其它页面。
            Response.Redirect("Proj_Project.aspx");
        }