public JsonResult GetUserTypeName() { DataControl.CurrentInfo _objcurrentInfo = new DataControl.CurrentInfo(); DataControl.BLMaster _objBlmaster = new DataControl.BLMaster(); DivisionUserProducts objDivUserProduct = new DivisionUserProducts(); objDivUserProduct.Company_Code = _objcurrentInfo.GetCompanyCode(); objDivUserProduct.User_Code = _objcurrentInfo.GetUserCode(); try { IEnumerable <DivisionUserProducts> lstDiv = _objBlmaster.GetUserTypeNames(objDivUserProduct); var division = (from div in lstDiv.AsEnumerable() select new DivisionUserProducts() { User_Type_Code = div.User_Type_Code.ToString(), User_Type_Name = div.User_Type_Name.ToString() }).ToList <DivisionUserProducts>(); return(Json(division)); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); dicContext.Add("Filter:companyCode", objDivUserProduct.Company_Code); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); return(Json("Sorry an error occured. Please try again later.")); } }
public JsonResult GetAPIServiceID() { DataControl.CurrentInfo _objcurrentInfo = new DataControl.CurrentInfo(); DataControl.BLMaster _objBlmaster = new DataControl.BLMaster(); APICategoryModel objDroAPICategory = new APICategoryModel(); string APIId = ""; try { IEnumerable <APIServiceModel> lstAPICategory = _objBlmaster.GetAPIServiceDetail(APIId); var apiCatlist = (from cat in lstAPICategory.AsEnumerable() select new APIServiceModel() { API_ID = cat.API_ID.ToString(), ServiceId = cat.ServiceId.ToString() }).ToList <APIServiceModel>(); return(Json(apiCatlist)); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); return(Json("Sorry an error occured. Please try again later.")); } }
public string UpdateSalesActivityMapping(string nprojectcode, string nactivityCode, string oprojectcode, string oactivityCode, string startDate, string endDate, string mode, string status) { try { DataControl.BLMaster _objBlMaster = new DataControl.BLMaster(); DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); return(_objBlMaster.UpdateSalesActivityMapping(_objCurInfo.GetCompanyCode(), nprojectcode, nactivityCode, oprojectcode, oactivityCode, mode, status, startDate, endDate, _objCurInfo.GetUserName(), DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"))); } catch (Exception ex) { Dictionary <string, string> dicObj = new Dictionary <string, string>(); dicObj.Add("NProjectCode", nprojectcode); dicObj.Add("NActivityCode", nactivityCode); dicObj.Add("OProjectCode", oprojectcode); dicObj.Add("OActivityCode", oactivityCode); dicObj.Add("Mode", mode); dicObj.Add("Status", status); dicObj.Add("StartDate", startDate); dicObj.Add("EndDate", endDate); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj); return("ERROR: " + ex.Message.ToString()); } }
public string InsertCompanyAppMapping(string appDetails) { CurrentInfo _objCurr = new CurrentInfo(); BLMaster _objMaster = new DataControl.BLMaster(); return(_objMaster.UpdateCompanyApp(_objCurr.GetCompanyCode(), appDetails, _objCurr.GetUserCode())); }
public string GetUserProjectDetails(int pageNo) { int totalPageNo = 1; const int PAGESIZE = 10; DataControl.JSONConverter json = new DataControl.JSONConverter(); List <UserProjectMapping> lstUserProject = new List <UserProjectMapping>(); List <UserProjectMapping> lstUserProjectFiler = new List <UserProjectMapping>(); DataControl.BLMaster _objMapping = new DataControl.BLMaster(); DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); string companyCode = _objCurInfo.GetCompanyCode(); StringBuilder sbTableContent = new StringBuilder(); lstUserProject = (List <UserProjectMapping>)_objMapping.GetUserProjectMapDetails(companyCode, pageNo, PAGESIZE, ref totalPageNo); lstUserProjectFiler = (List <UserProjectMapping>)_objMapping.GetUserProjectMapallDetails(companyCode); try { if (lstUserProject != null && lstUserProject.Count > 0) { sbTableContent.Append(Pager.Paging(pageNo, totalPageNo)); sbTableContent.Append("<table id='tblUserProject' class='table table-striped' >"); sbTableContent.Append("<thead class='active'>"); sbTableContent.Append("<tr style='background-color: #428bca'>"); sbTableContent.Append("<td>Edit</td>"); sbTableContent.Append("<td>Delete</td>"); sbTableContent.Append("<td>Project</td>"); sbTableContent.Append("<td>User</td>"); sbTableContent.Append("<td>Start Date</td>"); sbTableContent.Append("<td>End Date</td>"); sbTableContent.Append("</tr>"); sbTableContent.Append("</thead>"); sbTableContent.Append("<tbody>"); int i = 0; foreach (var item in lstUserProject) { i++; sbTableContent.Append("<tr><td><a href='#' onclick ='fnEdit(\"" + item.Project_Code.ToString() + "_" + item.User_Code.ToString() + "_" + item.Mapping_Code.ToString() + "_" + item.StartDate.ToString() + "_" + item.EndDate.ToString() + "\");'>Edit</a></td>"); sbTableContent.Append("<td><a href='#' onclick ='fnDelete(\"" + item.Project_Code.ToString() + "_" + item.User_Code.ToString() + "_" + item.Mapping_Code.ToString() + "\");'>Delete</a></td>"); sbTableContent.Append("<input type='hidden' id='hduserCode_" + i + "' value='" + item.User_Code.ToString() + "' />"); sbTableContent.Append("<input type='hidden' id='hdprojectCode_" + i + "' value='" + item.Project_Code.ToString() + "' />"); sbTableContent.Append("<td>" + item.Project_Name.ToString() + "</td>"); sbTableContent.Append("<td>" + item.User_Name.ToString() + "</td>"); sbTableContent.Append("<td>" + item.StartDate.ToString() + "</td>"); sbTableContent.Append("<td>" + item.EndDate.ToString() + "</td></tr>"); } } sbTableContent.Append("</tbody>"); sbTableContent.Append("</table>"); return(sbTableContent.ToString() + "*" + json.Serialize(lstUserProjectFiler)); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); dicContext.Add("Filter:companyCode", companyCode); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); return("Sorry an error occured. Please try again later."); } }
public string InsertProjectActivityMapping(string projectcode, string activityCode, string startDate, string endDate) { try { DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); DataControl.BLMaster _objBlMaster = new DataControl.BLMaster(); string createdBy = _objCurInfo.GetUserName(); return(_objBlMaster.InsertSalesActivityMapping(_objCurInfo.GetCompanyCode(), projectcode, activityCode, startDate, endDate, createdBy, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"))); } catch (Exception ex) { Dictionary <string, string> dicObj = new Dictionary <string, string>(); dicObj.Add("ProjectCode", projectcode); dicObj.Add("ActivityCode", activityCode); dicObj.Add("StartDate", startDate); dicObj.Add("EndDate", endDate); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj); return("ERROR: " + ex.Message.ToString()); } }
public string RegionChangeStatus(string regionTypeCode, string ChangeStatus) { try { string result = ""; string statusChange = "0"; if (ChangeStatus == "0") { statusChange = "1"; } else { statusChange = "0"; } DataControl.BLMaster _objBlmaster = new DataControl.BLMaster(); DataControl.CurrentInfo _objCurrentInfo = new DataControl.CurrentInfo(); string updatedDate = System.DateTime.Now.ToString("yyyy-MM-dd"); string status = _objBlmaster.RegionChangeStatus(_objCurrentInfo.GetCompanyCode(), regionTypeCode, statusChange, _objCurrentInfo.GetUserCode(), updatedDate); result = status.ToString(); return(result); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); dicContext.Add("Filter:RegionTypeCode", regionTypeCode); dicContext.Add("Filter:ChangeStatus", ChangeStatus); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); throw new Exception("Sorry an error occurred. Please try again later"); } }
public JsonResult GetAPIServiceMappedDetail(string APIServiceId) { DataControl.CurrentInfo _objcurrentInfo = new DataControl.CurrentInfo(); DataControl.BLMaster _objBlmaster = new DataControl.BLMaster(); string companyCode = _objcurrentInfo.GetCompanyCode(); try { IEnumerable <CompanyAccessModel> lstAPICategory = _objBlmaster.GetAPIComapanyMapDetail(APIServiceId, companyCode); var apiCatlist = (from cat in lstAPICategory.AsEnumerable() select new CompanyAccessModel() { API_ID = cat.API_ID.ToString(), Company_Code = cat.Company_Code, User_Type_Code = cat.User_Type_Code, }).ToList <CompanyAccessModel>(); return(Json(apiCatlist)); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); return(Json("Sorry an error occured. Please try again later.")); } }
public int InsertUserProduct(string userCode, string productCode, string minCounts, string maxCounts) { DataControl.BLMaster _objMapping = new DataControl.BLMaster(); DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); string companyCode = objCurInfo.GetCompanyCode(); userCode = userCode + ','; string currentDate = DateTime.Now.ToString("yyyy-MM-dd"); try { int result = _objMapping.InsertDivisionUserProductMapping(companyCode, userCode, productCode, minCounts, maxCounts); //int result = _objMapping.InsertDivUserProducts(companyCode, userCode, productCode, currentDate); return(result); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); dicContext.Add("Filter:companyCode", companyCode); dicContext.Add("Filter:UserCode", userCode); dicContext.Add("Filter:ProductCode", productCode); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); return(0); } }
public string GetAPIServiceDefinInputDetail(string APIServiceId) { DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); string companyCode = _objCurInfo.GetCompanyCode(); string[] APIparameter; try { DataControl.JSONConverter json = new DataControl.JSONConverter(); List <APIServiceModel> lstServiceMap = new List <APIServiceModel>(); DataControl.BLMaster _objMapping = new DataControl.BLMaster(); StringBuilder sbTableContent = new StringBuilder(); lstServiceMap = (List <APIServiceModel>)_objMapping.GetAPIServiceDetail(APIServiceId); if (lstServiceMap != null && lstServiceMap.Count > 0) { int i = 0; sbTableContent.Append("<table id='tblAPIInputs' class='table table-striped' >"); sbTableContent.Append("<thead class='active'>"); sbTableContent.Append("<tr style='background-color: #428bca'>"); sbTableContent.Append("<td>Service Parameters</td>"); sbTableContent.Append("<td>Display Order</td>"); sbTableContent.Append("<td>Get Session</td>"); sbTableContent.Append("<td>Session Key</td>"); sbTableContent.Append("<td>Show in UI</td>"); sbTableContent.Append("<td>Control type</td>"); sbTableContent.Append("<td>Description</td>"); sbTableContent.Append("</tr>"); sbTableContent.Append("</thead>"); sbTableContent.Append("<tbody>"); foreach (var item in lstServiceMap) { APIparameter = item.ServiceParams.Split(','); foreach (string splitParam in APIparameter) { i++; sbTableContent.Append("<tr ><td id='ParamName" + i + "'><span id='splitParam_" + i + "'>" + splitParam + "</span></td>"); sbTableContent.Append("<td id='textbox " + i + "'><input id='paramOrder_" + i + "'value='" + i + "' type='TextBox'></td>"); sbTableContent.Append("<td id='checkboxSession " + i + "'><input type='checkbox' onclick='fnGetSession()' id='Chk_getsession_" + i + "' name='chk_session' /></td>"); sbTableContent.Append("<td id='ddl " + i + "'><select id='ddlSessionSelection_" + i + "'><option value='0'>-Select Mode-</option> <option value='Comp_Code'>Comp_Code</option><option value='User_Code'>User_Code</option><option value='Region_Code'>Region_Code</option><option value='User_Type_Code'>User_Type_Code</option></select></td>"); sbTableContent.Append("<td id='checkUI " + i + "'><input type='checkbox' onclick='fnGetUI()' id='Chk_UI_" + i + "' Value='Y' name='chk_UI' /></td>"); sbTableContent.Append("<td id='ddlControl_ " + i + "'><select id='ddlControl_" + i + "'><option value='0'>-Select Mode-</option> <option value='TEXT'>TEXT</option><option value='DATE'>DATE</option><option value='TEXT_CSV'>TEXT_CSV</option></select></td>"); sbTableContent.Append("<td id='textarea " + i + "'><textarea id='Description_" + i + "'></textarea></td>"); } sbTableContent.Append("<td></td></tr>"); } } sbTableContent.Append("</tbody>"); sbTableContent.Append("</table>"); return(sbTableContent.ToString() + "*" + json.Serialize(lstServiceMap)); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); dicContext.Add("Filter:companyCode", companyCode); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); return("Sorry an error occured. Please try again later."); } }
public string GetPrivilegeAccessLogReport(string fromDate, string toDate, string userTypeCodes, string isExcel) { StringBuilder strContent = new StringBuilder(); string blobUrl = string.Empty; strContent.Append("<table><tr><td colspan='7' class='tblhead'>Privilege Log Report - Log Period " + fromDate.Split('-')[2] + "/" + fromDate.Split('-')[1] + "/" + fromDate.Split('-')[0] + " to " + toDate.Split('-')[2] + "/" + toDate.Split('-')[1] + "/" + toDate.Split('-')[0] + "</td></tr></table>"); strContent.Append("<table class='table table-striped'><thead><tr><th>S.No</th><th>Date</th><th>Privilege Name </th><th>Privilege Value Name</th>"); strContent.Append("<th>User Type Name</th><th>Record Status</th><th>Request from</th><th>Request Date</th><th>Request Reason</th>"); strContent.Append("<th>Support User Name</th><th>Updated By</th></tr></thead><tbody>"); try { DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); DataControl.BLMaster objMaster = new DataControl.BLMaster(); List <MVCModels.HiDoctor_Master.UserTypePrivilegeMappingModel> lstPrivilege = new List <MVCModels.HiDoctor_Master.UserTypePrivilegeMappingModel>(objMaster.GetPrivilegeLogReport(objCurInfo.GetCompanyCode(), fromDate, toDate, userTypeCodes)); int i = 0; if (lstPrivilege.Count > 0) { foreach (var dr in lstPrivilege) { i++; strContent.Append("<tr><td>" + i + "</td>"); strContent.Append("<td>" + dr.Mapping_Updated_Date + "</td>"); strContent.Append("<td>" + dr.Privilege_Name + "</td>"); strContent.Append("<td>" + dr.Privilege_Value_Name + "</td>"); strContent.Append("<td>" + dr.User_Type_Name + "</td>"); strContent.Append("<td>" + dr.Record_Status + "</td>"); strContent.Append("<td>" + dr.Request_From + "</td>"); strContent.Append("<td>" + dr.Request_Date + "</td>"); strContent.Append("<td>" + dr.Request_Reason + "</td>"); strContent.Append("<td>" + dr.Support_User_Name + "</td>"); strContent.Append("<td>" + dr.Mapping_Updated_By + "</td></tr>"); } } strContent.Append("</tbody>"); strContent.Append("</table>"); if ("Y" == isExcel) { DataControl.Abstraction.IConfigProvider iConfigPro = new DataControl.Impl.ConfigProvider(); DataControl.Repository.AzureBlobUpload objAzureBlob = new DataControl.Repository.AzureBlobUpload(); string accKey = iConfigPro.GetConfigValue("SWAASBLOBACCKEY"); string userName = objCurInfo.GetUserName(); string compCode = objCurInfo.GetCompanyCode(); string fileName = "PRIVILEGELOG_" + "_" + compCode + "_" + userName + ".xls"; blobUrl = objAzureBlob.AzureBlobUploadText(strContent.ToString(), accKey, fileName, "bulkdatasvc"); strContent.Clear(); strContent.Append(blobUrl); } } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); } return(strContent.ToString()); }
//For excell public void PutRequestCategoryMasterIntoExcel() { string blobUrl = string.Empty; string error = string.Empty; StringBuilder sbTableContent = new StringBuilder(); DataControl.CurrentInfo _objCurrentInfo = new DataControl.CurrentInfo(); string companyCode = _objCurrentInfo.GetCompanyCode(); StringBuilder sb = new StringBuilder(); DataControl.BLMaster _objBlmaster = new DataControl.BLMaster(); DataControl.Repository.FileDownload objFileDownload = new DataControl.Repository.FileDownload(); try { DataControl.JSONConverter json = new DataControl.JSONConverter(); List <RequestCategoryMasterModel> lstRequestMap = new List <RequestCategoryMasterModel>(); DataControl.BLMaster _objMapping = new DataControl.BLMaster(); lstRequestMap = (List <RequestCategoryMasterModel>)_objMapping.GetRequestCategoryDetail(companyCode); if (lstRequestMap != null && lstRequestMap.Count > 0) { sbTableContent.Append("<table id='tblrequest' class='table table-striped' >"); sbTableContent.Append("<thead class='active'>"); sbTableContent.Append("<tr style='background-color: #428bca'>"); sbTableContent.Append("<td>Request Category Name</td>"); sbTableContent.Append("<td>Status</td>"); sbTableContent.Append("</tr>"); sbTableContent.Append("</thead>"); sbTableContent.Append("<tbody>"); foreach (var item in lstRequestMap) { sbTableContent.Append("<tr><td>" + item.Request_Category_Name + "</td>"); sbTableContent.Append("<td>" + item.Request_Category_Status + "</td></tr>"); } } sbTableContent.Append("</tbody>"); sbTableContent.Append("</table>"); DataControl.Abstraction.IConfigProvider iConfigPro = new DataControl.Impl.ConfigProvider(); DataControl.Repository.AzureBlobUpload objAzureBlob = new DataControl.Repository.AzureBlobUpload(); string accKey = iConfigPro.GetConfigValue("SWAASBLOBACCKEY"); string userName = _objCurrentInfo.GetUserName(); string subdomainName = System.Web.HttpContext.Current.Request.Url.DnsSafeHost;; string fileName = "RequestCategoryMaster " + " - " + subdomainName + " - " + userName + ".xls"; blobUrl = objAzureBlob.AzureBlobUploadText(sbTableContent.ToString(), accKey, fileName, "bulkdatasvc"); objFileDownload.DownloadFile(blobUrl, fileName, out error); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>();; DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); } }
public JsonResult GetUserProducts(FormCollection collection) { string userCode = collection["User_Code"].ToString(); DataControl.BLMaster _objBlmaster = new DataControl.BLMaster(); List <UserProducts> obj = _objBlmaster.GetUserProducts(userCode); return(Json(obj, JsonRequestBehavior.AllowGet)); }
public int UpdateUserProject(string userCode, string projectCode, string startDate, string endDate, string oldprojectCode) { DataControl.BLMaster _objMapping = new DataControl.BLMaster(); DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); string companyCode = objCurInfo.GetCompanyCode(); int result = _objMapping.UpdateUserProject(companyCode, userCode, projectCode, startDate, endDate, oldprojectCode); return(result); }
//GetRegionTypeDetail public JsonResult GetRegionTypeDetail() { DataControl.BLMaster _objBlmaster = new DataControl.BLMaster(); DataControl.CurrentInfo _objCurrentInfo = new DataControl.CurrentInfo(); DataSet ds = new DataSet(); ds = _objBlmaster.GetRegiontypeDetailsAll(_objCurrentInfo.GetCompanyCode()); DataControl.JSONConverter _objJson = new DataControl.JSONConverter(); return(Json(_objJson.Serialize(ds), JsonRequestBehavior.AllowGet)); }
public void PutProjectActivityIntoAzure(FormCollection coll) { try { string error = string.Empty; DataControl.BLMaster _objBlMaster = new DataControl.BLMaster(); DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); DataControl.Repository.FileDownload objFileDownload = new DataControl.Repository.FileDownload(); DataControl.Abstraction.IFileProvider objProvider = new DataControl.Impl.FileSystemProvider(); StringBuilder tblBuilder = new StringBuilder(); string companyCode = _objCurInfo.GetCompanyCode(); int rowNum = 0; DataSet dsProjActMapp = _objBlMaster.GetSalesActivityMapping(companyCode); if (dsProjActMapp != null && dsProjActMapp.Tables.Count > 0 && dsProjActMapp.Tables[0].Rows.Count > 0) { tblBuilder.Append("<table id='tblSFC' class='table table-striped' cellpadding='0' cellspacing='0'>"); tblBuilder.Append("<thead><tr><th>Project Name</th><th>Activity Name</th><th>Start Date</th><th>End Date</th><th>Status</th></tr></thead>"); tblBuilder.Append("<tbody>"); foreach (DataRow dr in dsProjActMapp.Tables[0].Rows) { rowNum++; tblBuilder.Append("<tr>"); tblBuilder.Append("<td>" + dr["Project_Name"].ToString() + "<input type='hidden' id='hdnProjCode_" + rowNum + "' value='" + dr["Project_Code"].ToString() + "' /></td>"); tblBuilder.Append("<td>" + dr["Activity_Name"].ToString() + "<input type='hidden' id='hdnActivityCode_" + rowNum + "' value='" + dr["Activity_Code"].ToString() + "' /></td>"); tblBuilder.Append("<td id='tdStartDate_" + rowNum + "'>" + dr["StartDate"].ToString() + "</td>"); tblBuilder.Append("<td id='tdEndDate_" + rowNum + "'>" + dr["EndDate"].ToString() + "</td>"); tblBuilder.Append("<td id='tdStatus_" + rowNum + "'>" + dr["Status"].ToString() + "</td>"); tblBuilder.Append("</tr>"); } tblBuilder.Append("</tbody>"); tblBuilder.Append("</table>"); } DataControl.Abstraction.IConfigProvider iConfigPro = new DataControl.Impl.ConfigProvider(); DataControl.Repository.AzureBlobUpload objAzureBlob = new DataControl.Repository.AzureBlobUpload(); string accKey = iConfigPro.GetConfigValue("SWAASBLOBACCKEY"); string userName = _objCurInfo.GetUserName(); string subdomainName = HttpContext.Request.Url.DnsSafeHost.ToString(); string fileName = "ProjectActivityMapping" + " - " + subdomainName + " - " + userName + ".xls"; string blobUrl = objAzureBlob.AzureBlobUploadText(tblBuilder.ToString(), accKey, fileName, "bulkdatasvc"); objFileDownload.DownloadFile(blobUrl, fileName, out error); } catch (Exception ex) { Dictionary <string, string> dicObj = new Dictionary <string, string>(); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj); } }
public JsonResult GetUsers(string userTypeCode, string divisionCode) { DataControl.BLMaster _objBlmaster = new DataControl.BLMaster(); DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); List <MVCModels.DivisionUserProducts> lstuser = new List <MVCModels.DivisionUserProducts>(); string companyCode = _objCurInfo.GetCompanyCode(); lstuser = (List <MVCModels.DivisionUserProducts>)_objBlmaster.GetUsersByUserTypeAndDivision(companyCode, userTypeCode, divisionCode); DataControl.JSONConverter _objJson = new DataControl.JSONConverter(); return(Json(_objJson.Serialize(lstuser))); }
//public string GetDisabledUsers() //{ // StringBuilder strUsers = new StringBuilder(); // DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); // DataControl.BLUser objUser = new DataControl.BLUser(); // IEnumerable<MVCModels.HiDoctor_Master.UserModel> lstUser = null; // lstUser = objUser.GetDisabledUsers(objCurInfo.GetCompanyCode()); // strUsers.Append("<ul>"); // if (lstUser != null) // { // foreach (var user in lstUser) // { // strUsers.Append("<li onclick='fnGetUser(\"" + user.User_Code + "\")'>" + user.User_Name + "</li>"); // } // } // strUsers.Append("</ul>"); // return strUsers.ToString(); //} //public string GetResignedUserLeaveTakenReport() //{ // StringBuilder strTblContent = new StringBuilder(); // DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); // DataControl.BLUser objUser = new DataControl.BLUser(); // DataControl.BLLeave objLeave = new DataControl.BLLeave(); // return strTblContent.ToString(); //} #region get user menu access log report public string GetUserMenuAccessLogReport(string fromDate, string toDate, string userTypeCodes, string isExcel) { StringBuilder strContent = new StringBuilder(); string blobUrl = string.Empty; strContent.Append("<table><tr><td colspan='7' class='tblhead'>Menu Access Log Report - Log Period " + fromDate.Split('-')[2] + "/" + fromDate.Split('-')[1] + "/" + fromDate.Split('-')[0] + " to " + toDate.Split('-')[2] + "/" + toDate.Split('-')[1] + "/" + toDate.Split('-')[0] + "</td></tr></table>"); strContent.Append("<table class='table table-striped'><thead><tr><th>S.No</th><th>Date</th><th>User Type Name </th><th>Menu Name</th>"); strContent.Append("<th>Menu URL</th><th>Access</th><th>Changed By</th></tr></thead><tbody>"); try { DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); DataControl.BLMaster objMaster = new DataControl.BLMaster(); List <MVCModels.UserTypeMenuAccessModel> lstUserMenu = new List <UserTypeMenuAccessModel>(objMaster.GetUserTypeMenuAccessLog(objCurInfo.GetCompanyCode(), fromDate, toDate, userTypeCodes)); int i = 0; if (lstUserMenu.Count > 0) { foreach (var dr in lstUserMenu) { i++; strContent.Append("<tr><td>" + i + "</td>"); strContent.Append("<td>" + dr.Updated_Date + "</td>"); strContent.Append("<td>" + dr.User_Type_Name + "</td>"); strContent.Append("<td>" + dr.Menu_Text + "</td>"); strContent.Append("<td>" + dr.Menu_URL + "</td>"); strContent.Append("<td>" + dr.Access + "</td>"); strContent.Append("<td>" + dr.Updated_By + "</td></tr>"); } } strContent.Append("</tbody>"); strContent.Append("</table>"); if ("Y" == isExcel) { DataControl.Abstraction.IConfigProvider iConfigPro = new DataControl.Impl.ConfigProvider(); DataControl.Repository.AzureBlobUpload objAzureBlob = new DataControl.Repository.AzureBlobUpload(); string accKey = iConfigPro.GetConfigValue("SWAASBLOBACCKEY"); string userName = objCurInfo.GetUserName(); string compCode = objCurInfo.GetCompanyCode(); string fileName = "MENUACCESSLOG_" + "_" + compCode + "_" + userName + ".xls"; blobUrl = objAzureBlob.AzureBlobUploadText(strContent.ToString(), accKey, fileName, "bulkdatasvc"); strContent.Clear(); strContent.Append(blobUrl); } } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); } return(strContent.ToString()); }
public ActionResult DFCExcelBulkAddResult(HttpPostedFileBase file) { string result = ""; DataControl.BLMaster _objMast = new DataControl.BLMaster(); DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); string subDomain = _objCurInfo.GetSubDomain(); result = _objMast.InsertDFCExcelBulkUpload(subDomain, _objCurInfo.GetCompanyCode(), Guid.NewGuid().ToString(), file, _objCurInfo.GetUserCode()); ViewBag.ErrorCode = result; return(View("DFCExcelBulkAddResult")); }
public JsonResult GetPrivileges(string userTypeCode) { DataControl.BLMaster _objBlmaster = new DataControl.BLMaster(); DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); List <MVCModels.DivisionUserProducts> lstuser = new List <MVCModels.DivisionUserProducts>(); string companyCode = _objCurInfo.GetCompanyCode(); string privilageName = "DCR_PRODUCTS_BRING_TYPE"; lstuser = (List <MVCModels.DivisionUserProducts>)_objBlmaster.Getprivilagevalues(companyCode, userTypeCode, privilageName); DataControl.JSONConverter _objJson = new DataControl.JSONConverter(); return(Json(_objJson.Serialize(lstuser))); }
/// <summary> /// Method to Get the Project , Activity Details for prefilling /// </summary> /// <param name="coll"></param> /// <returns></returns> /// public JsonResult GetProjectActivityDetails(FormCollection coll) { try { DataControl.BLMaster _objBlMaster = new DataControl.BLMaster(); DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); DataSet dsProjAct = _objBlMaster.GetSalesActivity(_objCurInfo.GetCompanyCode()); return(Json(_objJson.Serialize(dsProjAct))); } catch (Exception ex) { Dictionary <string, string> dicObj = new Dictionary <string, string>(); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj); return(null); } }
public string GetAPIServiceUserType() { DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); string companyCode = _objCurInfo.GetCompanyCode(); try { DataControl.JSONConverter json = new DataControl.JSONConverter(); List <UserTypeModel> lstuserType = new List <UserTypeModel>(); DataControl.BLMaster _objMapping = new DataControl.BLMaster(); StringBuilder sbTableContent = new StringBuilder(); lstuserType = (List <UserTypeModel>)_objMapping.GetAPIUserTypeDetail(companyCode); if (lstuserType != null && lstuserType.Count > 0) { sbTableContent.Append("<table id='tblAPIUserType' class='table table-striped' >"); sbTableContent.Append("<thead class='active'>"); sbTableContent.Append("<tr style='background-color: #428bca'>"); sbTableContent.Append("<td>UserType Name</td>"); sbTableContent.Append("<td><input type='checkbox' id='bulkcheck'name='bulkchk_User' onclick='fnselectall()'/>Service Access</td>"); sbTableContent.Append("</tr>"); sbTableContent.Append("</thead>"); sbTableContent.Append("<tbody>"); int i = 0; foreach (var item in lstuserType) { i++; sbTableContent.Append("<tr ><td><span id='userTypeName_" + i + "'>" + item.User_Type_Name + "</span></td>"); sbTableContent.Append("<td id='checkboxAccess " + i + "'><input type='checkbox' id='Chk_Access_" + i + "'name='chk_Access' /></td>"); sbTableContent.Append("<td style='display:none'><span id='userTypeCode_" + i + "'>" + item.User_Type_Code + "</span></td>"); sbTableContent.Append("<td style='display:none'><span id='companyCode_" + i + "'>" + item.Company_Code + "</span></td>"); sbTableContent.Append("</tr>"); } } sbTableContent.Append("</tbody>"); sbTableContent.Append("</table>"); return(sbTableContent.ToString() + "*" + json.Serialize(lstuserType)); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); dicContext.Add("Filter:companyCode", companyCode); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); return("Sorry an error occured. Please try again later."); } }
public JsonResult GetKIRegionType(string RegionTypeName) { KI_RegionTypeModel obj = new KI_RegionTypeModel(); try { CurrentInfo _objCurrInfo = new CurrentInfo(); BLMaster _objBlmaster = new DataControl.BLMaster(); string companyCode = _objCurrInfo.GetCompanyCode(); obj = _objBlmaster.GetKIRegionType(companyCode, RegionTypeName); return(Json(obj, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw; } }
public bool GetRefKey_2(string refKey, string Regionclassificationname, string mode) { bool result = false; try { DataControl.BLMaster _objBlmaster = new DataControl.BLMaster(); CurrentInfo objCurInfo = new CurrentInfo(); string companyCode = objCurInfo.GetCompanyCode(); result = _objBlmaster.GetRefKey_2(companyCode, refKey, Regionclassificationname, mode); } catch (Exception ex) { throw (ex); } return(result); }
/// <summary> /// Method to get the Project - Activity Mapping details for the Grid /// </summary> /// <param name="coll"></param> /// <returns></returns> public string GetProjectActivityMappingDetails(FormCollection coll) { try { DataControl.BLMaster _objBlMaster = new DataControl.BLMaster(); DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); StringBuilder tblBuilder = new StringBuilder(); string companyCode = _objCurInfo.GetCompanyCode(); int rowNum = 0; DataSet dsProjActMapp = _objBlMaster.GetSalesActivityMapping(companyCode); if (dsProjActMapp != null && dsProjActMapp.Tables.Count > 0 && dsProjActMapp.Tables[0].Rows.Count > 0) { tblBuilder.Append("<table id='tblSFC' class='table table-striped' cellpadding='0' cellspacing='0'>"); tblBuilder.Append("<thead><tr><th class='Clstextleft'>Edit</th><th class='Clstextleft'>Change Status</th><th class='Clstextleft'>Project Name</th><th class='Clstextleft'>Activity Name</th><th class='Clstextleft'>Start Date</th><th class='Clstextleft'>End Date</th><th class='Clstextleft'>Status</th></tr></thead>"); tblBuilder.Append("<tbody>"); foreach (DataRow dr in dsProjActMapp.Tables[0].Rows) { rowNum++; tblBuilder.Append("<tr>"); tblBuilder.Append("<td> <a href='#' style='cursor:pointer' onclick='fnEditProjAct(" + rowNum + ")'>Edit</a></td>"); tblBuilder.Append("<td> <a href='#' style='cursor:pointer' onclick='fnchangeStatus(" + rowNum + ")'>Change Status</a></td>"); tblBuilder.Append("<td>" + dr["Project_Name"].ToString() + "<input type='hidden' id='hdnProjCode_" + rowNum + "' value='" + dr["Project_Code"].ToString() + "' /></td>"); tblBuilder.Append("<td>" + dr["Activity_Name"].ToString() + "<input type='hidden' id='hdnActivityCode_" + rowNum + "' value='" + dr["Activity_Code"].ToString() + "' /></td>"); tblBuilder.Append("<td id='tdStartDate_" + rowNum + "'>" + dr["StartDate"].ToString() + "</td>"); tblBuilder.Append("<td id='tdEndDate_" + rowNum + "'>" + dr["EndDate"].ToString() + "</td>"); tblBuilder.Append("<td id='tdStatus_" + rowNum + "'>" + dr["Status"].ToString() + "</td>"); tblBuilder.Append("</tr>"); } tblBuilder.Append("</tbody>"); tblBuilder.Append("</table>"); } return(tblBuilder.ToString()); } catch (Exception ex) { Dictionary <string, string> dicObj = new Dictionary <string, string>(); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicObj); return(ex.Message.ToString()); } }
public string GetCategoryDetail() { DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo(); string companyCode = _objCurInfo.GetCompanyCode(); try { DataControl.JSONConverter json = new DataControl.JSONConverter(); List <APICategoryModel> lstCategoryMap = new List <APICategoryModel>(); DataControl.BLMaster _objMapping = new DataControl.BLMaster(); StringBuilder sbTableContent = new StringBuilder(); lstCategoryMap = (List <APICategoryModel>)_objMapping.GetAPICategoryDetail(); if (lstCategoryMap != null && lstCategoryMap.Count > 0) { sbTableContent.Append("<table id='tblAPIcategory' class='table table-striped' >"); sbTableContent.Append("<thead class='active'>"); sbTableContent.Append("<tr style='background-color: #428bca'>"); sbTableContent.Append("<td>Edit</td>"); sbTableContent.Append("<td>API Category Name</td>"); sbTableContent.Append("<td>API Category Description</td>"); sbTableContent.Append("<td>Status</td>"); sbTableContent.Append("</tr>"); sbTableContent.Append("</thead>"); sbTableContent.Append("<tbody>"); foreach (var item in lstCategoryMap) { sbTableContent.Append("<tr><td><a href='#' style='color:blue' onclick ='fnEdit(\"" + item.API_Category_Code.ToString() + "_" + item.API_Category_Name.ToString() + "_" + item.API_Category_Description.ToString() + "_" + item.API_Category_Status.ToString() + "\");'>Edit</a></td>"); sbTableContent.Append("<td>" + item.API_Category_Name + "</td>"); sbTableContent.Append("<td>" + item.API_Category_Description + "</td>"); sbTableContent.Append("<td>" + item.API_Category_Status + "</td></tr>"); } } sbTableContent.Append("</tbody>"); sbTableContent.Append("</table>"); return(sbTableContent.ToString() + "*" + json.Serialize(lstCategoryMap)); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); dicContext.Add("Filter:companyCode", companyCode); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); return("Sorry an error occured. Please try again later."); } }
public int DeleteUserProject(string projectCode) { try { DataControl.BLMaster _objMapping = new DataControl.BLMaster(); DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); string companyCode = objCurInfo.GetCompanyCode(); int result = _objMapping.UpdateUserProjectMapping(companyCode, projectCode); return(result); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); dicContext.Add("Filter:ProjectCode", projectCode); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); return(2); } }
public int GetRefKey2(string Refkey2) { string companyCode = null; int result; try { DataControl.BLMaster _objBlmaster = new DataControl.BLMaster(); DataControl.CurrentInfo _objCurrentInfo = new DataControl.CurrentInfo(); companyCode = _objCurrentInfo.GetCompanyCode(); result = _objBlmaster.GetRefKey2(companyCode, Refkey2); return(result); } catch (Exception ex) { throw ex; } }
//REQUEST CATEGORY MASTER-SRI// public int InsertRequestCategory(string requestCategoryName, string status) { DataControl.BLMaster _objMapping = new DataControl.BLMaster(); DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo(); string companyCode = objCurInfo.GetCompanyCode(); try { int result = _objMapping.InsertRequestCategory(companyCode, requestCategoryName, status); return(result); } catch (Exception ex) { Dictionary <string, string> dicContext = new Dictionary <string, string>(); dicContext.Add("Filter:companyCode", companyCode); dicContext.Add("Filter:RequestCategoryName", requestCategoryName); dicContext.Add("Filter:Status", status); DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext); return(2); } }
public string SaveUserProduct(FormCollection collection) { string User_Code = collection["User_Code"].ToString(); string Product_Code = collection["Product_Code"].ToString(); int minCount = collection["minCount"].ToString() == "" ? 0 : Convert.ToInt32(collection["minCount"].ToString()); int maxCount = collection["maxCount"].ToString() == "" ? 0 : Convert.ToInt32(collection["maxCount"].ToString());; string User_Product_Status = collection["status"].ToString(); DataControl.BLMaster _objMapping = new DataControl.BLMaster(); string result = ""; try { result = _objMapping.SaveUserProduct(User_Code, Product_Code, minCount, maxCount, User_Product_Status); } catch (Exception ex) { throw ex; } return(result); }