/// <summary> /// Method is Used to get doctor category Details /// </summary> /// <returns></returns> private IEnumerable <MVCModels.HiDoctor_Master.DoctorModel> GetdoctorcategoryDetails() { try { MVCModels.HiDoctor_Master.DoctorModel objdoctoecategorymodel = new MVCModels.HiDoctor_Master.DoctorModel(); objdoctoecategorymodel.Company_Code = _objcurrentInfo.GetCompanyCode(); BLMaster objMaster = new BLMaster(); return(objMaster.GetdoctorCategoryDetails(objdoctoecategorymodel)); } catch (Exception ex) { Dictionary <string, string> dicObj = new Dictionary <string, string>(); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj); return(null); } }
public List <MVCModels.HiDoctor_Master.DoctorModel> GetApprovedDoctorsByRegion(string companyCode, string regionCode) { List <MVCModels.HiDoctor_Master.DoctorModel> lstDoctor = new List <MVCModels.HiDoctor_Master.DoctorModel>(); try { SqlCommand command = new SqlCommand(SP_HDGETAPPROVEDDOCTORSBYREGION); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); _objSPData.AddParamToSqlCommand(command, "@RegionCode", ParameterDirection.Input, SqlDbType.VarChar, 30, regionCode); _objData.OpenConnection(); using (sqlDataReader = _objData.ExecuteReader(command)) { while (sqlDataReader.Read()) { MVCModels.HiDoctor_Master.DoctorModel _objDoctor = new MVCModels.HiDoctor_Master.DoctorModel(); _objDoctor.Customer_Name = Convert.ToString(sqlDataReader["Customer_Name"]); _objDoctor.Region_Name = Convert.ToString(sqlDataReader["Region_Name"]); _objDoctor.Speciality_Name = Convert.ToString(sqlDataReader["Speciality_Name"]); _objDoctor.MDL_Number = Convert.ToString(sqlDataReader["MDL_Number"]); _objDoctor.Qualification = Convert.ToString(sqlDataReader["Qualification"]); _objDoctor.Customer_Code = Convert.ToString(sqlDataReader["Customer_Code"]); _objDoctor.Category_Name = Convert.ToString(sqlDataReader["Category_Name"]); lstDoctor.Add(_objDoctor); } } } catch (Exception ex) { Dictionary <string, string> dicObj = new Dictionary <string, string>(); dicObj.Add("regionCode", regionCode); DataControl.Impl.ExceptionHandler.WriteLog(ex: ex, dic: dicObj); throw ex; } finally { _objData.CloseConnection(); } return(lstDoctor); }
public string UpdateCustomerPriceGroup(string customerCodes, string priceGroupCode, string regionCode, string entity) { string result = string.Empty; DataControl.BLRegion objRegion = new DataControl.BLRegion(); DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); List <MVCModels.HiDoctor_Master.DoctorModel> lstCustomer = new List <MVCModels.HiDoctor_Master.DoctorModel>(); if (!string.IsNullOrEmpty(customerCodes)) { string[] ar; ar = customerCodes.Split('^'); foreach (var dr in ar) { if (!string.IsNullOrEmpty(dr.ToString())) { MVCModels.HiDoctor_Master.DoctorModel objCustomer = new MVCModels.HiDoctor_Master.DoctorModel(); objCustomer.Customer_Code = dr.ToString(); objCustomer.Price_Group_Code = priceGroupCode; objCustomer.Region_Code = regionCode; lstCustomer.Add(objCustomer); } } } int rowsAffected = 0; rowsAffected = objRegion.UpdateCustomerPriceGroup(objCurInfo.GetCompanyCode(), lstCustomer, regionCode, entity); if (rowsAffected > 0) { result = "SUCCESS:Customer Price group mapping done successfully"; } else { result = "ERROR:Error occured while mapping the price group to customer"; } return(result); }
/// <summary> /// Get DivisionName /// </summary> /// <returns></returns> public JsonResult GetDivisionName() { try { BLMaster objMaster = new BLMaster(); MVCModels.HiDoctor_Master.DoctorModel objDivisonName = new MVCModels.HiDoctor_Master.DoctorModel(); objDivisonName.Company_Code = _objcurrentInfo.GetCompanyCode(); IEnumerable <MVCModels.HiDoctor_Master.DoctorModel> lstdivisonName = objMaster.GetDivisionName(objDivisonName); var DivisionList = (from division in lstdivisonName.AsEnumerable() select new MVCModels.HiDoctor_Master.DoctorModel() { Division_Name = division.Division_Name.ToString(), Division_Code = division.Division_Code.ToString() }).ToList <MVCModels.HiDoctor_Master.DoctorModel>(); return(Json(DivisionList)); } catch (Exception ex) { Dictionary <string, string> dicObj = new Dictionary <string, string>(); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj); return(null); } }
public int InsertandUpdateforDoctorcategoryMaster(string CategoryName, string VisitCount, string DoctorCount, string divisionCode, string EffectiveFrom, string EffectiveTo, string mode, string Doccategotycodeval) { try { BLMaster Master = new BLMaster(); MVCModels.HiDoctor_Master.DoctorModel objdoctorcategoryModel = new MVCModels.HiDoctor_Master.DoctorModel(); List <MVCModels.HiDoctor_Master.DoctorModel> lstdoctorcategoryModel = new List <MVCModels.HiDoctor_Master.DoctorModel>(); if (mode.ToUpper() == "I") // Insert Data { objdoctorcategoryModel.Company_Code = _objcurrentInfo.GetCompanyCode(); objdoctorcategoryModel.Category_Name = CategoryName; if (string.IsNullOrEmpty(DoctorCount)) { DoctorCount = "0"; } objdoctorcategoryModel.Doctor_Count = DoctorCount; objdoctorcategoryModel.Visit_Count = VisitCount; objdoctorcategoryModel.Effective_From = EffectiveFrom; objdoctorcategoryModel.Effective_To = EffectiveTo; objdoctorcategoryModel.Status = "1"; objdoctorcategoryModel.Division_Code = divisionCode; objdoctorcategoryModel.Created_By = _objcurrentInfo.GetUserName(); objdoctorcategoryModel.Created_Date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"); lstdoctorcategoryModel.Add(objdoctorcategoryModel); int result = Master.InsertforDoctorCategoryMaster(lstdoctorcategoryModel); return(result); } else { objdoctorcategoryModel.Company_Code = _objcurrentInfo.GetCompanyCode(); objdoctorcategoryModel.Category_Code = Doccategotycodeval; objdoctorcategoryModel.Category_Name = CategoryName; objdoctorcategoryModel.Effective_From = EffectiveFrom; objdoctorcategoryModel.Effective_To = EffectiveTo; objdoctorcategoryModel.Visit_Count = VisitCount; if (string.IsNullOrEmpty(DoctorCount)) { DoctorCount = "0"; } objdoctorcategoryModel.Doctor_Count = DoctorCount; objdoctorcategoryModel.Division_Code = divisionCode; objdoctorcategoryModel.Updated_By = _objcurrentInfo.GetUserName(); objdoctorcategoryModel.Updated_Date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"); lstdoctorcategoryModel.Add(objdoctorcategoryModel); int result = Master.UpdateforDoctorcategoryMaster(lstdoctorcategoryModel); return(result); } } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); dicContext.Add("Filter:CategoryName", CategoryName); dicContext.Add("Filter:VisitCount", VisitCount); dicContext.Add("Filter:DoctorCount", DoctorCount); dicContext.Add("Filter:mode", mode); dicContext.Add("Filter:EffectiveFrom", EffectiveFrom); dicContext.Add("Filter:EffectiveTo", EffectiveTo); dicContext.Add("Filter:Doccategotycodeval", Doccategotycodeval); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); return(0); } }