示例#1
0
    public void Edit2(int id, string name, object BGAMID, string oldValue, string newValue, object customer)
    {
        int       deptid  = DepID;
        string    message = " {0}<br /><b>原收入经费:</b> {1}<br /><b>更改收入经费:</b> {2}";
        bool      flag    = false;
        BG_Amount ma      = new BG_Amount();

        ma = BG_AmountLogic.GetBG_AmountByYear(id, common.IntSafeConvert(cmbyear.SelectedItem.Value), deptid);
        if (ma == null)
        {
            ma            = new BG_Amount();
            ma.BGAMIncome = ParToDecimal.ParToDel(newValue);
            ma.DepID      = deptid;
            ma.BGAMYear   = common.IntSafeConvert(cmbyear.SelectedItem.Value);
            ma.CBID       = id;
            flag          = BG_AmountManager.AddBG_Amount(ma).BGAMID > 0;
        }
        else
        {
            ma.BGAMIncome = ParToDecimal.ParToDel(newValue);
            flag          = BG_AmountManager.ModifyBG_Amount(ma);
        }
        if (flag)
        {
            X.Msg.Notify(new NotificationConfig()
            {
                Title = "消息提示",
                Html  = string.Format(message, common.IntSafeConvert(cmbyear.SelectedItem.Value) - 1 + "年" + "口径:" + name.Split('、')[1], oldValue, newValue),
                Width = 250
            }).Show();
        }
    }
示例#2
0
    public void Edit(int id, string name, object BGAMID, string oldValue, string newValue, object customer)
    {
        int deptid = DepID;

        if (UserLimStr == "审核员")
        {
            deptid = common.IntSafeConvert(cmbdept.SelectedItem.Value);
            editnum.Disable(true);
        }
        string    message = " {0}<br /><b>原支出经费:</b> {1}<br /><b>更改支出经费:</b> {2}";
        bool      flag    = false;
        BG_Amount ma      = new BG_Amount();

        ma = BG_AmountLogic.GetBG_AmountByYear(id, common.IntSafeConvert(cmbyear.SelectedItem.Value), deptid);
        if (ma == null)
        {
            ma          = new BG_Amount();
            ma.BGAMMon  = ParToDecimal.ParToDel(newValue);
            ma.DepID    = deptid;
            ma.BGAMYear = common.IntSafeConvert(cmbyear.SelectedItem.Value);
            ma.CBID     = id;
            flag        = BG_AmountManager.AddBG_Amount(ma).BGAMID > 0;
        }
        else
        {
            ma.BGAMMon = ParToDecimal.ParToDel(newValue);
            flag       = BG_AmountManager.ModifyBG_Amount(ma);
        }
        if (flag)
        {
            X.Msg.Notify(new NotificationConfig()
            {
                Title = "消息提示",
                Html  = string.Format(message, common.IntSafeConvert(cmbyear.SelectedItem.Value) + "年" + "口径:" + name.Split('、')[1], oldValue, newValue),
                Width = 250
            }).Show();
        }
        // Send Message...


        //this.GridPanel1.GetStore().GetById(id).Commit();
    }