Beispiel #1
0
        public Result UpdateRatioFreezing(Model.DB.Unit model)
        {
            ApiResultEnum result = UnitDA.UpdateRatioFreezing(model);

            if (result == ApiResultEnum.Success && MonitorRA.GetStatusTrade() != 0)
            {
                UnitRA.UpdateRatioFreezing(model.ratio_freezing, "U_" + model.id);
            }
            return(Result(result));
        }
Beispiel #2
0
        public Result Update(Model.DB.Unit model)
        {
            ApiResultEnum result = UnitDA.Update(model);

            if (result == ApiResultEnum.Success && MonitorRA.GetStatusTrade() != 0)
            {
                OpenCloseBiz.LoadUnit(model, false);
            }
            return(Result(result));
        }
Beispiel #3
0
        public Result <int> Add(Model.DB.Unit model)
        {
            int id = 0;

            model.created_by        = user_id;
            model.status_order_enum = StatusOrderEnum.Allowed;
            ApiResultEnum result = UnitDA.Add(model, ref id);

            if (result == ApiResultEnum.Success && MonitorRA.GetStatusTrade() != 0)
            {
                model.id = id;
                OpenCloseBiz.LoadUnit(model);
            }
            return(Result(result, id));
        }
Beispiel #4
0
        public Result <UnitCapital> GetUnitCapital(int unit_id)
        {
            Model.DB.Unit unit        = UnitRA.Get("U_" + unit_id);
            UnitCapital   unitCapital = new UnitCapital();

            if (unit != null)
            {
                unitCapital.available = unit.capital_available;
                unitCapital.scale     = unit.capital_scale;
                unitCapital.balance   = unit.capital_balance;
                unitCapital.value     = unit.capital_stock_value;
                unitCapital.assets    = unit.capital_total;
                unitCapital.profit    = unit.capital_profit;
            }
            return(Result(unitCapital));
        }
Beispiel #5
0
 public Result Delete(Model.DB.Unit model)
 {
     return(Result(UnitDA.Delete(model, user_id)));
 }