public StockistEntityModel GetStockistWiseDetails(string companyCode, string regionCode, string customerCode, string customerEntityType, string gridId) { StockistEntityModel _objStockist = new StockistEntityModel(); try { _objStockist.Customer_Entity_Type = customerEntityType; _objStockist.GridId = gridId; List <ChemistStockistHeaderModel> lsthdr = null; List <EntityAddressModel> lstAddre = null; using (IDbConnection conn = IDbOpenConnection()) { var p = new DynamicParameters(); p.Add("@CompanyCode", companyCode); p.Add("@RegionCode", regionCode); p.Add("@CustomerCode", customerCode); p.Add("@CustomerEntityType", customerEntityType); var multiselect = conn.QueryMultiple(SP_HD_BPP_GETENTITYWISEDETAILS, p, commandType: CommandType.StoredProcedure); lsthdr = multiselect.Read <ChemistStockistHeaderModel>().ToList(); lstAddre = multiselect.Read <EntityAddressModel>().ToList(); _objStockist.lstStockist = lsthdr; _objStockist.lstAddress = lstAddre; conn.Close(); } } catch (Exception ex) { throw; } return(_objStockist); }
public StockistEntityModel GetStockistWiseDetails(string companyCode, string regionCode, string customerCode, string customerEntityType, string gridId) { StockistEntityModel _objStockist = new StockistEntityModel(); try { _objStockist = _objBeat.GetStockistWiseDetails(companyCode, regionCode, customerCode, customerEntityType, gridId); } catch (Exception ex) { throw; } return(_objStockist); }
/// <summary> /// /// </summary> /// <param name="companyCode"></param> /// <param name="regionCode"></param> /// <param name="customerCode"></param> /// <param name="customerEntityType"></param> /// <param name="gridId"></param> /// <returns></returns> public JsonResult GetEntityWiseDetails(string companyCode, string regionCode, string customerCode, string customerEntityType, string gridId) { CustomerEntityModel _ObjDoctor = new CustomerEntityModel(); ChemistEntityModel _ObjChemist = new ChemistEntityModel(); StockistEntityModel _ObjStockist = new StockistEntityModel(); object _objreturn = new object(); if (customerEntityType.ToUpper() == "DOCTOR") { _ObjDoctor = _ObjBeat.GetDoctorWiseDetails(companyCode, regionCode, customerCode, customerEntityType, gridId); _objreturn = _ObjDoctor; } else if (customerEntityType.ToUpper() == "CHEMIST") { _ObjChemist = _ObjBeat.GetChemistWiseDetails(companyCode, regionCode, customerCode, customerEntityType, gridId); _objreturn = _ObjChemist; } else if (customerEntityType.ToUpper() == "STOCKIEST") { _ObjStockist = _ObjBeat.GetStockistWiseDetails(companyCode, regionCode, customerCode, customerEntityType, gridId); _objreturn = _ObjStockist; } return(Json(_objreturn, JsonRequestBehavior.AllowGet)); }