public JsonResult GetPriceGroupMappedCustomers(string regionCode, string entity) { StringBuilder strContent = new StringBuilder(); DataControl.BL_Customer objCutomer = new DataControl.BL_Customer(); DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); List <MVCModels.HiDoctor_Master.DoctorModel> lstCustomer = new List <MVCModels.HiDoctor_Master.DoctorModel>(objCutomer.GetCustomersByRegionAndEntity(objCurInfo.GetCompanyCode(), regionCode, entity)); return(Json(_objJson.Serialize(lstCustomer))); }
public string GetCustomersByRegionAndEntity(string regionCode, string entity, string priceGroupCode) { StringBuilder strContent = new StringBuilder(); DataControl.BL_Customer objCutomer = new DataControl.BL_Customer(); IEnumerable <MVCModels.HiDoctor_Master.DoctorModel> lstCustomer = null; DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); List <MVCModels.HiDoctor_Master.DoctorModel> lstCustPriceGroup = new List <MVCModels.HiDoctor_Master.DoctorModel>(objCutomer.GetCustomersByPriceGroupCode(objCurInfo.GetCompanyCode(), regionCode, priceGroupCode, entity)); lstCustomer = objCutomer.GetCustomersByRegionAndEntity(objCurInfo.GetCompanyCode(), regionCode, entity); strContent.Append("<table class='table table-striped' id='tblCustomer'><thead><tr><td>S.No</td>"); strContent.Append("<td><input type='checkbox' name='chkSelectAllCustomer' onclick='fnSelectAllCustomers();'/></td>"); strContent.Append("<td>Customer Name</td></tr></thead>"); int i = 0; if (lstCustomer != null) { foreach (var dr in lstCustomer) { i++; strContent.Append("<tr><td>" + i + "</td>"); if (lstCustPriceGroup != null) { var filterd = lstCustPriceGroup.AsEnumerable().Where(z => z.Customer_Code == dr.Customer_Code.ToString()).ToList(); if (filterd.Count > 0) { strContent.Append("<td><input type='checkbox' checked='checked' id='chkSelect_" + i + "' name='chkSelectCustomer' value='" + dr.Customer_Code + "'/></td>"); } else { strContent.Append("<td><input type='checkbox' id='chkSelect_" + i + "' name='chkSelectCustomer' value='" + dr.Customer_Code + "'/></td>"); } } else { strContent.Append("<td><input type='checkbox' id='chkSelect_" + i + "' name='chkSelectCustomer' value='" + dr.Customer_Code + "'/></td>"); } strContent.Append("<td>" + dr.Customer_Name + "</td>"); strContent.Append("</tr>"); } strContent.Append("</table>"); } return(strContent.ToString()); }