Пример #1
0
        public ChemistEntityModel GetChemistWiseDetails(string companyCode, string regionCode, string customerCode, string customerEntityType, string gridId)
        {
            ChemistEntityModel _objChemist = new ChemistEntityModel();

            try
            {
                _objChemist.Customer_Entity_Type = customerEntityType;
                _objChemist.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();
                    _objChemist.lstChemist = lsthdr;
                    _objChemist.lstAddress = lstAddre;
                    conn.Close();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return(_objChemist);
        }
Пример #2
0
        public ChemistEntityModel GetChemistWiseDetails(string companyCode, string regionCode, string customerCode, string customerEntityType, string gridId)
        {
            ChemistEntityModel _objChemist = new ChemistEntityModel();

            try
            {
                _objChemist = _objBeat.GetChemistWiseDetails(companyCode, regionCode, customerCode, customerEntityType, gridId);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(_objChemist);
        }
Пример #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));
        }