Esempio n. 1
0
        public void FinanceSetting(string opeType, FinanceSettingsInfo info, string operatorId)
        {
            try
            {
                using (var manage = new UserBalanceManager())
                {
                    if (info != null)
                    {
                        FinanceSettings entity = new FinanceSettings();
                        ObjectConvert.ConverInfoToEntity(info, ref entity);
                        entity.OperatorId = operatorId;
                        entity.CreateTime = DateTime.Now;
                        switch (opeType.ToLower())
                        {
                        case "add":
                            AddFinanceSettings(entity);
                            break;

                        case "update":
                            //UpdateFinanceSettings(entity);
                            manage.UpdateFinanceSettings(entity);
                            break;

                        case "delete":
                            manage.DeleteFinanceSettings(entity.FinanceId.ToString());
                            break;
                        }
                    }
                    else
                    {
                        if (opeType.ToLower() != "delete")
                        {
                            throw new Exception("保存数据失败!");
                        }
                        else
                        {
                            throw new Exception("删除数据失败!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }