Ejemplo n.º 1
0
 //删除
 protected void Delete_Click(object sender, EventArgs e)
 {
     try
     {
         int    ProjectID = Convert.ToInt32(Request.QueryString["id"].ToString());
         int    attachId  = bllProject.FindBudget(ProjectID);
         string srcPath   = bllAttachment.FindPath(attachId);
         if (attachId == 0 || srcPath == "")
         {
             Alert.Show("该项目不存在相关文档");
         }
         else
         {
             publicmethod.DeleteFile(attachId, srcPath);
             Common.Entities.Project project = bllProject.FindProject(ProjectID, Convert.ToInt32(Session["SecrecyLevel"])).FirstOrDefault();
             project.BudgetAttachment = null;
             bllProject.Update(project);
             Alert.Show("删除成功!");
             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideReference() + Alert.GetShowInTopReference("删除成功!"));
         }
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
Ejemplo n.º 2
0
 //初始化
 public void InitData()
 {
     try
     {
         int ProjectID = Convert.ToInt32(Request.QueryString["id"].ToString());
         List <Common.Entities.Project> list    = bllProject.FindProject(ProjectID, Convert.ToInt32(Session["SecrecyLevel"]));
         Common.Entities.Project        project = list.FirstOrDefault();
         ProjectName.Text  = project.ProjectName;
         ProjectState.Text = project.ProjectState;
         ProjectHeads.Text = project.ProjectHeads;
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);;
     }
 }
Ejemplo n.º 3
0
 protected void tb_ProjectName_TextChanged(object sender, EventArgs e)
 {
     Common.Entities.Project project = blpro.IsNullProject(tb_ProjectName.Text.Trim());
     if (project == null)
     {
         tb_ProjectName.Text = "";
         Alert.ShowInTop("无此项目,请检查输入!");
     }
     else if (project.IsPass == false)
     {
         tb_ProjectName.Text = "";
         Alert.ShowInTop("此项目正在审核中,请联系管理员!");
         return;
     }
     else
     {
         return;
     }
 }
Ejemplo n.º 4
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (tb_MoneyNum.Text.Trim() == "")
                {
                    Alert.ShowInTop("每项用途所用金额不能为空!");
                    tb_MoneyNum.Text = "";
                    return;
                }
                Common.Entities.Project project = blpro.IsNullProject(tb_ProjectName.Text.Trim());
                if (project == null)
                {
                    tb_ProjectName.Text = "";
                    Alert.ShowInTop("无此项目,请检查输入!");
                    return;
                }
                else if (project.IsPass == false)
                {
                    tb_ProjectName.Text = "";
                    Alert.ShowInTop("此项目正在审核中,请联系管理员!");
                    return;
                }
                double num = 0.0;
                if (!double.TryParse(tb_MoneyNum.Text.Trim(), out num))
                {
                    tb_MoneyNum.Reset();
                    Alert.ShowInTop("请输入数字!");
                    return;
                }
                if (dp_Time.SelectedDate == null)
                {
                    Alert.ShowInTop("请选择日期!");
                    return;
                }
                Common.Entities.FundInformation fun = new Common.Entities.FundInformation();
                Common.Entities.OperationLog    op  = new Common.Entities.OperationLog();


                fun.BudgetDirector = tb_BudgetDirector.Text.Trim();

                BLHelper.BLLUser user     = new BLHelper.BLLUser();
                string           username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                fun.EntryPerson     = username;
                fun.EveItemUseMoney = tb_MoneyNum.Text.Trim();
                fun.OperateType     = "进账";
                fun.ProjectID       = blpro.SelectProjectID(tb_ProjectName.Text);
                fun.SecrecyLevel    = Convert.ToInt32(ddl_level.SelectedValue) + 1;
                fun.Time            = dp_Time.SelectedDate;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    fun.IsPass = true;
                    blfund.Insert(fun);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                }
                else
                {
                    fun.IsPass = false;
                    blfund.Insert(fun);
                    op.LoginIP          = " ";
                    op.LoginName        = Session["LoginName"].ToString();
                    op.OperationContent = "FundInformation";
                    op.OperationDataID  = fun.FundInformationID;
                    op.OperationTime    = DateTime.Now;
                    op.OperationType    = "添加";
                    blop.Insert(op);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("数据已经提交,请等待管理员确认!"));
                }
            }
            catch (Exception ex)
            {
                BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
            }
        }