Exemplo n.º 1
0
        public CustomerEntityModel GetDoctorWiseDetails(string companyCode, string regionCode, string customerCode, string customerEntityType, string gridId)
        {
            CustomerEntityModel _objDoctor = new CustomerEntityModel();

            try
            {
                _objDoctor.Customer_Entity_Type = customerEntityType;
                _objDoctor.GridId = gridId;
                List <CustomerHeaderModel> lsthdr   = null;
                List <EntityAddressModel>  lstAddre = null;
                List <HospitalModel>       lstHosp  = 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 <CustomerHeaderModel>().ToList();
                    lstAddre               = multiselect.Read <EntityAddressModel>().ToList();
                    lstHosp                = multiselect.Read <HospitalModel>().ToList();
                    _objDoctor.lstDoctor   = lsthdr;
                    _objDoctor.lstAddress  = lstAddre;
                    _objDoctor.lstHospital = lstHosp;
                    conn.Close();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return(_objDoctor);
        }
Exemplo n.º 2
0
        public CustomerEntityModel GetDoctorWiseDetails(string companyCode, string regionCode, string customerCode, string customerEntityType, string gridId)
        {
            CustomerEntityModel _objDoctor = new CustomerEntityModel();

            try
            {
                _objDoctor = _objBeat.GetDoctorWiseDetails(companyCode, regionCode, customerCode, customerEntityType, gridId);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(_objDoctor);
        }
Exemplo n.º 3
0
        /// <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));
        }