Ejemplo n.º 1
0
    protected void btnSure_DirectClick(object sender, DirectEventArgs e)
    {
        string name = "";

        try
        {
            name = ComboBox1.SelectedItem.Value;
        }
        catch
        {
            X.Msg.Alert("系统提示", "请选择科目名称。").Show();
            return;
        }
        if (tfMon.Text == "")
        {
            X.Msg.Alert("系统提示", "请填写经费。").Show();
            return;
        }
        string bgpi  = BG_BudItemsLogic.GetBG_PayIncomeByname(name);
        int    piid  = common.IntSafeConvert(bgpi.Split(',')[0]);
        int    year  = Convert.ToInt32(HidYear.Value);
        int    depid = Convert.ToInt32(HidDepid.Value);
        BG_EstimatesAllocation ba = new BG_EstimatesAllocation();

        ba.DepID   = depid;
        ba.PIID    = piid;
        ba.BEAYear = year;
        ba.BEAMon  = ParToDecimal.ParToDel(tfMon.Text);
        if (Convert.ToDecimal(tatal.Value) - ba.BEAMon > 0)
        {
            if (BGBudItemsService.Isba(year, piid, depid) > 0)
            {
                ba.BEAID = BGBudItemsService.IsBEAba(year, piid, depid);
                BG_EstimatesAllocationManager.ModifyBG_EstimatesAllocation(ba);
            }
            else
            {
                BG_EstimatesAllocationManager.AddBG_EstimatesAllocation(ba);
            }
            Window1.Hidden = true;
            AddDataBind();
            DtDataBind();
        }
        else
        {
            X.Msg.Alert("提示", "预算金额不足,无法分配!").Show();
        }
    }
 /// <summary>
 /// 添加一条预算项目信息
 /// </summary>
 /// <param name="budItems">一条预算项目实例</param>
 /// <returns>bool</returns>
 public static bool AddbudItems(BG_BudItems budItems)
 {
     return(BGBudItemsService.AddbudItems(budItems));
 }
 public static DataTable GetBudItemsListByDepid(int depId, int year)
 {
     return(BGBudItemsService.GetBudItemsListByDepid(depId, year));
 }
 public static DataTable GetApplyReimburByDepID(int DepID, int year)
 {
     return(BGBudItemsService.GetApplyReimburByDepID(DepID, year));
 }
 /// <summary>
 /// 查询指定部门下所有预算信息
 /// </summary>
 /// <param name="arid">预算信息</param>
 /// <returns>BGUser</returns>
 public static DataTable GetApplyReimburByDepIDPager(int DepID, int pageIndex, int PageSize, out int RecordCount)
 {
     return(BGBudItemsService.GetApplyReimburByDepIDPager(DepID, pageIndex, PageSize, out RecordCount));
 }
 /// <summary>
 /// 根据部门ID查询BudItemsList(未提交、退回)
 /// </summary>
 /// <param name="Depid">部门ID</param>
 /// <returns>DataTable</returns>
 public static DataTable GetBudItemsListByDepidPager(int Depid, int pageIndex, int PageSize, out int RecordCount)
 {
     return(BGBudItemsService.GetBudItemsListByDepidPager(Depid, pageIndex, PageSize, out RecordCount));
 }
 /// <summary>
 ///填写审核不通过原因
 /// </summary>
 /// <param name="budItems">BICause</param>
 /// <returns>BGBudItems</returns>
 public static bool SelBi(string bICause)
 {
     return(BGBudItemsService.SelBi(bICause));
 }
 /// <summary>
 /// 删除指定预算项目信息
 /// </summary>
 /// <param name="budID">BudID</param>
 /// <returns>bool</returns>
 public static bool DelBud(int budID)
 {
     return(BGBudItemsService.DelBud(budID));
 }
 /// <summary>
 /// 添加BGBudItems并返回其ID
 /// </summary>
 /// <param name="budItems"></param>
 /// <returns>int</returns>
 public static int AddBudItemsBackbuid(BG_BudItems budItems)
 {
     return(BGBudItemsService.AddBudItemsBackbuid(budItems));
 }
 /// <summary>
 /// 查询指定部门下所有报销审核通过信息
 /// </summary>
 /// <param name="arid">报销申请信息</param>
 /// <returns>BGUser</returns>
 public static DataTable GetApplyReimburSByDepID(int DepID)
 {
     return(BGBudItemsService.GetApplyReimburByDepID(DepID, "审核通过"));
 }
 /// <summary>
 /// 获取项目自增编号
 /// </summary>
 /// <returns></returns>
 public static string GetBICode(string year)
 {
     return(BGBudItemsService.GetBICode(year));
 }
 public static DataTable GetBIPagerByProtypeYear(string protype, string year, int pageIndex, int PageSize, out int RecordCount)
 {
     return(BGBudItemsService.GetBIPagerByProtypeYear(protype, year, pageIndex, PageSize, out RecordCount));
 }
 /// <summary>
 /// 查询指定部门下所有预算(按状态查询的)信息
 /// </summary>
 /// <param name="arid">预算信息</param>
 /// <returns>BGUser</returns>
 public static DataTable GetApplyReimburByDepID(int DepID, string sta)
 {
     return(BGBudItemsService.GetApplyReimburByDepID(DepID, sta));
 }
 /// <summary>
 /// 查询指定部门下所有预算(按状态查询的)信息
 /// </summary>
 /// <param name="arid">预算信息</param>
 /// <returns>BGUser</returns>
 public static DataTable GetApplyReimburByDepIDPager(int DepID, string sta, int pageIndex, int PageSize, out int RecordCount, int CurrentYear)
 {
     return(BGBudItemsService.GetApplyReimburByDepIDPager(DepID, sta, pageIndex, PageSize, out RecordCount, CurrentYear));
 }
 /// <summary>
 /// 通过预算项目ID查询信息
 /// </summary>
 /// <param name="budItems">项目ID</param>
 /// <returns>BGBudItems</returns>
 public static DataTable GetBudItemsListByBudItemsID(int Budid)
 {
     return(BGBudItemsService.GetBudItemsListByBudid(Budid));
 }
 /// <summary>
 /// 修改指定预算项目信息
 /// </summary>
 /// <param name="budItems">BGBudItems</param>
 /// <returns>bool</returns>
 public static bool UpdBudItems(BG_BudItems budItems)
 {
     return(BGBudItemsService.UpdBudItems(budItems));
 }
 /// <summary>
 /// 根据Budid获取单条BGBudItems记录
 /// </summary>
 /// <param name="biid"></param>
 /// <returns></returns>
 public static BG_BudItems GetBudItemsByBudid(int Budid)
 {
     return(BGBudItemsService.GetBudItemsByBudid(Budid));
 }
 /// <summary>
 /// 更改预算项目状态
 /// </summary>
 /// <param name="budid">BudID</param>
 /// <returns>bool</returns>
 public static bool UpdBudSta(int budid, string status)
 {
     return(BGBudItemsService.UpdBudSta(budid, status));
 }
 /// <summary>
 /// 按项目类型汇总
 /// </summary>
 /// <param name="arid">预算信息</param>
 /// <returns>BGUser</returns>
 public static DataTable GetSummaryBudInfo(string sta)
 {
     return(BGBudItemsService.GetSummaryBudInfo(sta));
 }
 /// <summary>
 /// 按项目类型汇总123
 /// </summary>
 /// <param name="arid">预算信息</param>
 /// <returns>BGUser</returns>
 public static DataTable GetSummaryBudInfoPager(string sta, int pageIndex, int pageSize, out int RecordCount, int CurrentYear)
 {
     return(BGBudItemsService.GetSummaryBudInfoPager(sta, pageIndex, pageSize, out RecordCount, CurrentYear));
 }
 /// <summary>
 /// 根据部门ID查询BudItemsList
 /// </summary>
 /// <param name="Depid">部门ID</param>
 /// <returns>DataTable</returns>
 public static DataTable GetBudItemsListByDepid(int Depid)
 {
     return(BGBudItemsService.GetBudItemsListByDepid(Depid));
 }