예제 #1
0
        //获取产品类型
        public static List <FinancialType> GetFinancialType(string asset_condition, string bp_id, string group_id, string model_cde, string app_type)
        {
            var result = new List <FinancialType>();

            if (string.IsNullOrEmpty(bp_id) || string.IsNullOrEmpty(group_id) || string.IsNullOrEmpty(model_cde))
            {
                return(result);
            }
            string asset_code = "";
            string type       = "";

            if (app_type == "00001")
            {
                type = "I";
            }
            else if (app_type == "00002")
            {
                type = "C";
            }
            else
            {
                return(result);
            }

            if (asset_condition == "N")
            {
                asset_code = "00001";
            }
            else if (asset_condition == "U")
            {
                asset_code = "00002";
            }
            else
            {
                return(result);
            }

            string sql = @"
select distinct financial_product_id,financial_product_nme financial_product_dsc from V_FP_ASSET_DEALER_LOCAL v 
where v.business_partner_id={0} 
and v.asset_model_cde='{2}'
and v.fp_group_id={1}
and v.FLEET_COMP_INDIV_IND='{3}'
and v.asset_condition_cde='{4}'
order by financial_product_nme 
";

            sql = string.Format(sql, bp_id, group_id, model_cde, type, asset_code);
            AppUtility.Engine.LogWriter.Write("获取产品sql-->" + sql);
            DataTable dt = ExecuteDataTableSql(cap_db_connectcode, sql);

            foreach (DataRow dr in dt.Rows)
            {
                var v = new FinancialType();
                v.financial_product_id  = dr["financial_product_id"] + string.Empty;
                v.financial_product_dsc = dr["financial_product_dsc"] + string.Empty;
                result.Add(v);
            }
            return(result);
        }
예제 #2
0
        public HttpResponseMessage UpdateFinancialType(HttpRequestMessage request, [FromBody] FinancialType financialTypeModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var financialType = _CoreService.UpdateFinancialType(financialTypeModel);

                return request.CreateResponse <FinancialType>(HttpStatusCode.OK, financialType);
            }));
        }
예제 #3
0
 public static IFinanceService Create(FinancialType financialType, params object[] parameters)
 {
     try
     {
         return(null);
     }
     catch (Exception ex)
     {
         throw new FinancialException("工厂构造异常:\r\n" + ex.ToString());
     }
 }
예제 #4
0
        public HttpResponseMessage GetFinancialType(HttpRequestMessage request, int financialTypeId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                FinancialType financialType = _CoreService.GetFinancialType(financialTypeId);

                // notice no need to create a seperate model object since FinancialType entity will do just fine
                response = request.CreateResponse <FinancialType>(HttpStatusCode.OK, financialType);

                return response;
            }));
        }
예제 #5
0
 public int GetNewNumber(FinancialType type)
 {
     lock (sharedLock)
     {
         //Thread.Sleep(random.Next(10, 1000));
         if (db.Any(x => x.Type == type))
         {
             return(db.Where(x => x.Type == type).OrderByDescending(x => x.Number).First().Number + 1);
         }
         else
         {
             return(1);
         }
     }
 }
예제 #6
0
        public HttpResponseMessage DeleteFinancialType(HttpRequestMessage request, [FromBody] int financialTypeId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                FinancialType financialType = _CoreService.GetFinancialType(financialTypeId);

                if (financialType != null)
                {
                    _CoreService.DeleteFinancialType(financialTypeId);

                    response = request.CreateResponse(HttpStatusCode.OK);
                }
                else
                {
                    response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No financialType found under that ID.");
                }

                return response;
            }));
        }
 public FinancialType UpdateFinancialType(FinancialType financialType)
 {
     return(Channel.UpdateFinancialType(financialType));
 }