Esempio n. 1
0
        /// <summary>
        /// DownLoad The statusMasterDetails into Excel
        /// </summary>
        /// <returns></returns>
        public void PutStatusMasterIntoExcel()
        {
            string companycode = _objcurrentInfo.GetCompanyCode();
            string error       = string.Empty;

            try
            {
                List <StatusMasterModel> lstStatusMaster = (List <StatusMasterModel>)GetStatusMasterDetails();
                StringBuilder            sb = new StringBuilder();
                BLMaster objMaster          = new BLMaster();
                DataControl.Repository.FileDownload   objFileDownload = new DataControl.Repository.FileDownload();
                DataControl.Abstraction.IFileProvider objProvider     = new DataControl.Impl.FileSystemProvider();
                sb.Append("<table WIDTH='40%' id='tblsummary' class='table table-striped'>");
                sb.Append("<thead class='active'>");
                sb.Append("<tr style='background-color:#428bca;'>");
                sb.Append("<td>Status Name</td>");
                sb.Append("<td>Display Name</td>");
                sb.Append("<td>Status</td>");
                sb.Append("</tr>");
                sb.Append("</thead>");
                sb.Append("<tbody>");

                if (lstStatusMaster != null && lstStatusMaster.Count > 0)
                {
                    int i = 0;
                    foreach (var lstStatus in lstStatusMaster)
                    {
                        i++;
                        sb.Append("<td id='Status_Name" + i + "'>" + lstStatus.Status_Name + "</td>");
                        sb.Append("<td id='Display_Name" + i + "'>" + lstStatus.Display_Name + "</td>");
                        sb.Append("<td id='Record_Status" + i + "'>" + lstStatus.Record_Status + "</td></tr>");
                    }
                }
                else
                {
                    sb.Append("<span>No Records TO Display</span>");
                }
                sb.Append("</body>");
                sb.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 = "Status Master" + " - " + subdomainName + " - " + userName + ".xls";
                string blobUrl  = objAzureBlob.AzureBlobUploadText(sb.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);
            }
        }
Esempio n. 2
0
 public ActionResult NewLeaveEntry(string SSID)
 {
     if (!string.IsNullOrEmpty(SSID))
     {
         string         parameters = System.Text.ASCIIEncoding.ASCII.GetString(System.Convert.FromBase64String(SSID));
         DieticianModel obj        = Newtonsoft.Json.JsonConvert.DeserializeObject <DieticianModel>(parameters);
         ViewBag.CompanyCode  = obj.Company_Code;
         ViewBag.RegionCode   = obj.Region_Code;
         ViewBag.UserCode     = obj.User_Code;
         ViewBag.UserTypeCode = obj.User_Type_Code;
         ViewBag.UserName     = obj.User_Name;
         ViewBag.RegionName   = obj.Region_Name;
         ViewBag.latitude     = obj.latitude;
         ViewBag.longitude    = obj.longitude;
     }
     else
     {
         DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
         ViewBag.Companycode  = objCurInfo.GetCompanyCode();
         ViewBag.Usercode     = objCurInfo.GetUserCode();
         ViewBag.RegionCode   = objCurInfo.GetRegionCode();
         ViewBag.UserTypecode = objCurInfo.GetUserTypeCode();
         ViewBag.UserName     = objCurInfo.GetUserName();
     }
     return(View());
 }
Esempio n. 3
0
        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());
            }
        }
Esempio n. 4
0
        /// <summary>
        /// DownLoad The ActivityMasterDetails into Excel
        /// </summary>
        public void PutActivityMasterIntoExcel()
        {
            string error = string.Empty;

            StringBuilder sb = new StringBuilder();

            try
            {
                string companyCode = _objcurrentInfo.GetCompanyCode();
                DataControl.Repository.FileDownload   objFileDownload = new DataControl.Repository.FileDownload();
                DataControl.Abstraction.IFileProvider objProvider     = new DataControl.Impl.FileSystemProvider();
                BLMaster Master           = new BLMaster();
                DataSet  dsActivityMaster = new DataSet();
                dsActivityMaster = Master.GetLeaveTypeDetails(companyCode);
                //dsc
                sb.Append("<table WIDTH='75%' id='tblsummary' class='table table-striped'>");
                sb.Append("<thead class='active'>");
                sb.Append("<tr style='background-color:#428bca;'>");
                sb.Append("<td>Activity Name</td>");
                sb.Append("<td>Start Date</td>");
                sb.Append("<td>End Date</td>");
                sb.Append("<td>Status</td>");
                sb.Append("</tr>");
                sb.Append("<tbody>");
                //
                if (dsActivityMaster != null && dsActivityMaster.Tables[0] != null && dsActivityMaster.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < dsActivityMaster.Tables[0].Rows.Count; i++)
                    {
                        sb.Append("<td id='Activity_Name" + i + "'style='text-align:left;'>" + dsActivityMaster.Tables[0].Rows[i]["Activity_Name"] + "</td>");
                        sb.Append("<td id='Start_Date" + i + " 'style='text-align:left;'>" + dsActivityMaster.Tables[0].Rows[i]["Start_Date"] + "</td>");
                        sb.Append("<td id='End_Date" + i + " ' style='text-align:left;'>" + dsActivityMaster.Tables[0].Rows[i]["End_Date"] + "</td>");
                        sb.Append("<td id='Row_Status" + i + " 'style='text-align:left;'>" + dsActivityMaster.Tables[0].Rows[i]["Row_Status"] + "</td></tr>");
                    }
                }
                else
                {
                    sb.Append("<tr><td>No records To Display</td></tr>");
                }
                sb.Append("</tbody>");
                sb.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 = "ActivityMaster" + " - " + subdomainName + " - " + userName + ".xls";
                string blobUrl  = objAzureBlob.AzureBlobUploadText(sb.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);
            }
        }
Esempio n. 5
0
        public int InsertCampaignPlanner(string regionCode, string regionName, string cpName, string categoryCode, string categoryName,
                                         string sfcDetails, string doctorDetails, string Mode, string CPCode, string workArea, string CPStatus, string EditPrivilege)
        {
            int rowsAffected = 0;

            try
            {
                DataControl.CurrentInfo       _objCurInfo = new DataControl.CurrentInfo();
                DataControl.BLCampaignPlanner _objBlCP    = new DataControl.BLCampaignPlanner();
                rowsAffected = _objBlCP.InsertCampaignPlanner(_objCurInfo.GetCompanyCode(), regionCode, regionName, cpName, categoryCode,
                                                              categoryName, sfcDetails, doctorDetails,
                                                              Mode, CPCode, _objCurInfo.GetUserName(), workArea, CPStatus, EditPrivilege);
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                dicObj.Add("regionCode", regionCode);
                dicObj.Add("regionName", regionName);
                dicObj.Add("cpName", cpName);
                dicObj.Add("categoryCode", categoryCode);
                dicObj.Add("categoryName", categoryName);
                dicObj.Add("sfcDetails", sfcDetails);
                dicObj.Add("doctorDetails", doctorDetails);
                dicObj.Add("Mode", Mode);
                dicObj.Add("CPCode", CPCode);
                DataControl.Impl.ExceptionHandler.WriteLog(ex: ex, dic: dicObj);
            }
            return(rowsAffected);
        }
Esempio n. 6
0
        public int HolidayInheritance(string sourceRegion, string destinationRegions)
        {
            int rowsAffected = 0;

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            try
            {
                List <MVCModels.HiDoctor_Master.RegionModel> lstRegion = new List <MVCModels.HiDoctor_Master.RegionModel>();
                DataControl.BLRegion objRegion = new DataControl.BLRegion();
                if (!string.IsNullOrEmpty(destinationRegions))
                {
                    string[] ar = destinationRegions.Split(',');
                    foreach (var region in ar)
                    {
                        if (!string.IsNullOrEmpty(region))
                        {
                            MVCModels.HiDoctor_Master.RegionModel objRegionModel = new MVCModels.HiDoctor_Master.RegionModel();
                            objRegionModel.Region_Code = region;
                            lstRegion.Add(objRegionModel);
                        }
                    }
                    rowsAffected = objRegion.HolidayInheritance(objCurInfo.GetCompanyCode(), sourceRegion, lstRegion,
                                                                objCurInfo.GetUserName(), System.DateTime.Now.ToString("yyyy-MM-dd"));
                }
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                DataControl.Impl.ExceptionHandler.WriteLog(ex: ex, dic: dicObj);
                return(0);
            }
            return(rowsAffected);
        }
Esempio n. 7
0
        public void GetHolidayExcelDownload(FormCollection coll)
        {
            string blobUrl = string.Empty, error = string.Empty;

            DataControl.Repository.FileDownload objFileDownload = new DataControl.Repository.FileDownload();
            string holidayDate = string.Empty;

            if (!string.IsNullOrEmpty(coll["hdnSearchDate"]))
            {
                holidayDate = Convert.ToString(coll["hdnSearchDate"]);
            }
            try
            {
                System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
                DataControl.CurrentInfo _objCurr = new DataControl.CurrentInfo();
                string content = GetSearchHolidayDetails(holidayDate);

                DataControl.Abstraction.IConfigProvider iConfigPro   = new DataControl.Impl.ConfigProvider();
                DataControl.Repository.AzureBlobUpload  objAzureBlob = new DataControl.Repository.AzureBlobUpload();
                string accKey   = iConfigPro.GetConfigValue("SWAASBLOBACCKEY");
                string userName = _objCurr.GetUserName();
                string subDomin = _objCurr.GetSubDomain();
                string fileName = "HolidayMaster" + "_" + subDomin + "_" + userName + ".xls";

                blobUrl = objAzureBlob.AzureBlobUploadText(content.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: ex, dic: dicObj);
            }
        }
Esempio n. 8
0
        public ActionResult OrderAdd(string id)
        {
            BLUser objUser = new BLUser();
            List <MVCModels.HiDoctor_Master.UserModel> lstUser = new List <MVCModels.HiDoctor_Master.UserModel>();

            lstUser = objUser.GetChildUsersCodeAndNameOnly(_objCurrentInfo.GetCompanyCode(), _objCurrentInfo.GetUserCode());
            ViewBag.Child_User_Count = lstUser.Count();

            string OrderMode = id.Split('~')[0];

            if (OrderMode == "Add")
            {
                ViewBag.OrderMode          = OrderMode;
                ViewBag.action_Region_Code = _objCurrentInfo.GetRegionCode();
            }
            else
            {
                ViewBag.OrderMode          = OrderMode;
                ViewBag.Order_Id           = id.Split('~')[1];
                ViewBag.action_Region_Code = id.Split('~')[2];
            }

            ViewBag.Current_Date = System.DateTime.Now.ToString("yyyy-MM-dd");

            ViewBag.action_User_Name = _objCurrentInfo.GetUserName();
            ViewBag.action_User_Code = _objCurrentInfo.GetUserCode();
            ViewBag.Current_Month    = System.DateTime.Now.Month + "-" + System.DateTime.Now.Year;
            ViewBag.Previous_Month   = System.DateTime.Now.AddMonths(-1).Month + "-" + System.DateTime.Now.AddMonths(-1).Year;
            ViewBag.Next_Month       = System.DateTime.Now.AddMonths(1).Month + "-" + System.DateTime.Now.AddMonths(1).Year;
            return(View());
        }
Esempio n. 9
0
        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());
        }
Esempio n. 10
0
        public string SetDCRUnapprove(string dcrDate, string unapprovealReason, string flag, string calcFieldStatus)
        {
            string companyCode = _objCurrentInfo.GetCompanyCode();
            string userName    = _objCurrentInfo.GetUserName();
            string userCode    = _objCurrentInfo.GetUserCode();
            string dcrCode     = _objCurrentInfo.GetDCRCode(dcrDate);

            calcFieldStatus = calcFieldStatus.ToUpper() == "APPLIED" ? "1" : "2";
            string result = string.Empty;

            result = _objSPData.CheckTheDCRCanbeUnapprove(companyCode, userCode, dcrCode, flag);
            if (result == "SUCCESS")
            {
                result = _objSPData.SetDCRUnapprove(companyCode, userCode, userName, dcrDate, dcrCode, flag, unapprovealReason, calcFieldStatus);
            }
            return(result);
        }
Esempio n. 11
0
        //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);
            }
        }
Esempio n. 12
0
        public void PutPayslipmetadataintoExcel()
        {
            string error = string.Empty;

            StringBuilder sb = new StringBuilder();

            try
            {
                DataControl.BLUser      objBlUser   = new BLUser();
                DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo();
                string companyCode = _objCurInfo.GetCompanyCode();

                DataControl.Repository.FileDownload   objFileDownload = new DataControl.Repository.FileDownload();
                DataControl.Abstraction.IFileProvider objProvider     = new DataControl.Impl.FileSystemProvider();

                List <MVCModels.HiDoctor_Master.PaySlipMetaDataModel> lstdata = new List <MVCModels.HiDoctor_Master.PaySlipMetaDataModel>();
                lstdata = objBlUser.GetpaysliprefsheetDetail(companyCode).ToList();



                DataControl.Abstraction.IConfigProvider iConfigPro   = new DataControl.Impl.ConfigProvider();
                DataControl.Repository.AzureBlobUpload  objAzureBlob = new DataControl.Repository.AzureBlobUpload();
                string accKey = iConfigPro.GetConfigValue("SWAASBLOBACCKEY");

                sb.Append("<table WIDTH='40%' id='tblpaysummary' class='table table-striped'>");
                sb.Append("<thead class='active'>");
                sb.Append("<tr style='background-color:#428bca;'>");
                sb.Append("<td>User Type Name</td>");
                sb.Append("<td>Column No</td>");
                sb.Append("<td>Column Name</td>");
                sb.Append("<td>DataTypeName</td>");
                sb.Append("</tr>");
                sb.Append("</thead>");
                sb.Append("<tbody>");
                if (lstdata.Count > 0)
                {
                    foreach (var lstPayMetadata in lstdata)
                    {
                        sb.Append("<tr><td>" + lstPayMetadata.User_Type_Name + "</td>");
                        sb.Append("<td>" + lstPayMetadata.Column_No + "</td>");
                        sb.Append("<td>" + lstPayMetadata.Column_Name + "</td>");
                        sb.Append("<td>" + lstPayMetadata.DataTypeAliasName + "</td></tr>");
                    }
                }
                string userName      = _objCurInfo.GetUserName();
                string subdomainName = System.Web.HttpContext.Current.Request.Url.DnsSafeHost;;

                string fileName = "PaySlipMetaData" + " - " + subdomainName + " - " + userName + ".xls";
                string blobUrl  = objAzureBlob.AzureBlobUploadText(sb.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);
            }
        }
Esempio n. 13
0
 /// <summary>
 /// Insert and Update
 /// </summary>
 /// <param name="subRegionCodeVal"></param>
 /// <param name="subRegionName"></param>
 /// <param name="UnderRegionName"></param>
 /// <param name="underRegionCode"></param>
 /// <param name="mode"></param>
 /// <returns></returns>
 public int InsertandUpdateSubRegionmaster(string subRegionCodeVal, string subRegionName, string UnderRegionName, string underRegionCode, string mode)
 {
     try
     {
         BLMaster                    _objMaster         = new BLMaster();
         SubRegionMasterModel        objSubRegion       = new SubRegionMasterModel();
         List <SubRegionMasterModel> lstSubRegionMaster = new List <SubRegionMasterModel>();
         if (mode.ToUpper() == "I") // Insert the Date
         {
             objSubRegion.Company_Code     = _objcurrentInfo.GetCompanyCode();
             objSubRegion.SubRegion_Name   = subRegionName;
             objSubRegion.SubRegion_Status = "1";
             objSubRegion.UnderRegion_Code = UnderRegionName;
             objSubRegion.Created_By       = _objcurrentInfo.GetUserName();
             objSubRegion.Created_Date     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff");
             lstSubRegionMaster.Add(objSubRegion);
             int result = _objMaster.InsertforSubRegionMaster(lstSubRegionMaster);
             return(result);
         }
         else
         {
             objSubRegion.Company_Code     = _objcurrentInfo.GetCompanyCode();
             objSubRegion.SubRegion_Code   = subRegionCodeVal;
             objSubRegion.SubRegion_Name   = subRegionName;
             objSubRegion.UnderRegion_Code = UnderRegionName;
             objSubRegion.Updated_By       = _objcurrentInfo.GetUserName();
             objSubRegion.Updated_Date     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff");
             lstSubRegionMaster.Add(objSubRegion);
             int result = _objMaster.UpdateforSubRegionMaster(lstSubRegionMaster);
             return(result);
         }
     }
     catch (Exception ex)
     {
         Dictionary <string, string> dicContext = new Dictionary <string, string>();
         dicContext.Add("Filter:subRegionName", subRegionName);
         dicContext.Add("Filter:subRegionCodeVal", subRegionCodeVal);
         dicContext.Add("Filter:underRegionCode", underRegionCode);
         dicContext.Add("Filter:mode", mode);
         DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
         return(0);
     }
 }
Esempio n. 14
0
        ///DcrStatusMaster for HospitalField/////
        public bool InsertMappedHospitalRegionsField(List <DCRRegionModel> lstRegions)
        {
            bool result = false;

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            string UserName = objCurInfo.GetUserName();

            result = _objBLDcrStatusMaster.InsertMappedHospitalRegionsField(lstRegions, UserName);
            return(result);
        }
Esempio n. 15
0
        public int UnMapHospitalRegionsField(string Regioncode)
        {
            int result = 0;

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            string UserName = objCurInfo.GetUserName();

            result = _objBLDcrStatusMaster.UnMapHospitalRegionsField(Regioncode, UserName);
            return(result);
        }
Esempio n. 16
0
        public string UploadAttachment(FormCollection coll)
        {
            try
            {
                System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
                DataControl.CurrentInfo objCur = new DataControl.CurrentInfo();
                string companyCode             = objCur.GetCompanyCode();
                string newFilename             = string.Empty;
                var    container = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(
                    ConfigurationManager.AppSettings["NBBLOBACCKEY"]).CreateCloudBlobClient()
                                   .GetContainerReference(companyCode.ToLower());
                container.CreateIfNotExists();

                //int blocksCount = int.Parse(coll["blocksCount"].ToString());
                //string fileName = coll["fileName"].ToString();
                //long fileSize = long.Parse(coll["fileSize"].ToString());

                int    blocksCount = int.Parse(coll["blocksCount"].ToString());
                string fileName    = coll["fileName"].ToString();
                fileName    = fileName.Substring(fileName.LastIndexOf("\\") + 1);
                newFilename = fileName;
                string fileExtenstion = fileName.Substring(fileName.LastIndexOf("."));
                long   fileSize       = long.Parse(coll["fileSize"].ToString());
                newFilename = newFilename.Substring(0, newFilename.LastIndexOf('.'));
                newFilename = newFilename.ToString().Trim().Replace(" ", "_");

                //Special Character are replaced.
                newFilename = Regex.Replace(newFilename, @"[^0-9a-zA-Z_]+", "_");

                fileName = newFilename + "_" + objCur.GetUserName() + "_" + DateTime.Now.ToString("ddMMyyyyHHmmssfff") + fileExtenstion;

                var fileToUpload = new MVCModels.CloudFile()
                {
                    BlockCount          = blocksCount,
                    FileName            = fileName,
                    Size                = fileSize,
                    BlockBlob           = container.GetBlockBlobReference(fileName),
                    StartTime           = DateTime.Now,
                    IsUploadCompleted   = false,
                    UploadStatusMessage = string.Empty
                };
                Session.Add("CurrentFile", fileToUpload);
                return(fileName);
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();

                dicContext.Add("Method:", MethodBase.GetCurrentMethod().Name);

                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);

                throw ex;
            }
        }
Esempio n. 17
0
        //Send Password
        public string GetandSendPassWord(string newPassWord, string usercode, int mailvalue)
        {
            string companyCode = _objcurrentInfo.GetCompanyCode();
            string userName    = _objcurrentInfo.GetUserName();
            string strmail     = "";
            string strMailid   = "";
            string strUserName = "";
            string result      = "";

            try
            {
                DataSet dsEmail    = new DataSet();
                DataSet dspassword = new DataSet();
                BLUser  _objUser   = new BLUser();

                if (mailvalue == 0)
                {
                    dspassword  = _objUser.GetPassword(companyCode, usercode);
                    strUserName = dspassword.Tables[0].Rows[0]["User_Name"].ToString();
                    string pwdflag = _objUser.UpdatePasswordReset(companyCode, usercode, newPassWord);
                    result = "SAVED";
                }
                else
                {
                    dsEmail = _objUser.checkEmailid(companyCode, usercode);
                    if (dsEmail.Tables[0].Rows.Count > 0)
                    {
                        strMailid   = dsEmail.Tables[0].Rows[0]["Email_Id"].ToString();
                        dspassword  = _objUser.GetPassword(companyCode, usercode);
                        strUserName = dspassword.Tables[0].Rows[0]["User_Name"].ToString();
                        string pwdflag = _objUser.UpdatePasswordReset(companyCode, usercode, newPassWord);

                        if (!string.IsNullOrEmpty(strMailid))
                        {
                            strmail = SendMail(newPassWord, strUserName, strMailid);
                            result  = strmail + "*" + strMailid;
                        }
                    }
                    else
                    {
                        result = "ERROR";
                    }
                }
                return(result);
            }

            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:UserName", usercode);
                dicContext.Add("Filter:newPassWord", newPassWord);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return(ex.Message.ToString());
            }
        }
Esempio n. 18
0
        //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());
        }
Esempio n. 19
0
        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);
            }
        }
Esempio n. 20
0
        public int AddNewStatus(string Division, string Usertype, string Status, string Catagory, string NewStatus)
        {
            int result = 0;

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            string companyCode = objCurInfo.GetCompanyCode();
            string username    = objCurInfo.GetUserName();

            result = _objBLDcrStatusMaster.AddNewStatus(companyCode, username, Usertype, Division, Status, Catagory, NewStatus);
            return(result);
        }
Esempio n. 21
0
        // Inert or update Sales order(applied or drafted status)
        public string InsertOTC(string orderId, string orderDate, string isSubmit, string productString, string custCode, string salesPersonCode
                                , string salesPersonName, string orderValue, string remarks, string refNumber, string productCodes, string offerCodes, string dueDate)
        {
            BAL_OTC objBALOTC = new BAL_OTC();

            salesPersonCode = (salesPersonCode == IsSession) ? _objcurrentInfo.GetRegionCode() : salesPersonCode;
            string enterBy       = _objcurrentInfo.GetUserCode();
            string enterByRegion = _objcurrentInfo.GetRegionCode();

            salesPersonName = (salesPersonName == "") ? _objcurrentInfo.GetUserName() : salesPersonName.Split('(')[0];
            return(objBALOTC.InsertOTC(_objcurrentInfo.GetCompanyCode(), orderId, orderDate, isSubmit, productString, custCode, salesPersonCode, salesPersonName, enterBy, enterByRegion, orderValue, remarks, refNumber, productCodes, offerCodes, dueDate));
        }
Esempio n. 22
0
        //
        // GET: /Division/

        public ActionResult Index()
        {
            DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo();
            string getusertypename = GetUserType();

            ViewBag.getusertypename = getusertypename;
            ViewBag.CompanyCode     = _objCurInfo.GetCompanyCode();
            ViewBag.UserName        = _objCurInfo.GetUserName();
            ViewBag.User_Code       = _objCurInfo.GetUserCode();
            ViewBag.Region_Code     = _objCurInfo.GetRegionCode();
            return(View());
        }
Esempio n. 23
0
        public int UnmapRegionslock(string Regioncode)
        {
            int result = 0;

            _objBLRegion    = new BLRegion();
            _objcurrentInfo = new CurrentInfo();

            string UserName = string.Empty;

            UserName = _objcurrentInfo.GetUserName();
            result   = _objBLRegion.UnmapRegionslock(Regioncode, UserName);
            return(result);
        }
Esempio n. 24
0
        public string GenerateYearWiseHolidayExcel(string regionCodes, string year, string SearchKey, int pageNumber, bool excelDownload)
        {
            int count          = 0;
            int totalPageCount = 0;

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            DataControl.BLRegion    objRegion  = new DataControl.BLRegion();
            IEnumerable <MVCModels.HiDoctor_Master.HolidayModel> lstHoliday = null;

            lstHoliday = objRegion.GetMappedHolidayDetails(objCurInfo.GetCompanyCode(), regionCodes, year, SearchKey, pageNumber, excelDownload, PAGESIZE,
                                                           ref totalPageCount);
            StringBuilder strContent      = new StringBuilder();
            StringBuilder strExcelContent = new StringBuilder();

            strExcelContent.Append("<table class='table table-striped'><thead><tr><td>S.No</td><td>Date</td><td>Holiday Name</td>");
            strExcelContent.Append("<td>Region Name</td><td>Region Type</td><td>Reporting Region</td><td>Reporting Region Type</td></tr></thead>");
            if (lstHoliday != null)
            {
                int i = 0;
                foreach (var dr in lstHoliday)
                {
                    i++;

                    strExcelContent.Append("<tr><td>" + i + "</td>");
                    strExcelContent.Append("<td><span id='lblHolidayDate_" + i + "'>" + dr.Holiday_Date + "</span></td>");
                    strExcelContent.Append("<td><span id='lblHolidayName_" + i + "'>" + dr.Holiday_Name + "</span></td>");
                    strExcelContent.Append("<td>" + dr.Region_Name + "<input type='hidden' id='hdnRegionCode_" + i + "' value='" + dr.Region_Code + "'/></td>");
                    strExcelContent.Append("<td>" + dr.Region_Type_Name + "</td>");
                    strExcelContent.Append("<td>" + dr.Reporting_Region_Name + "</td>");
                    strExcelContent.Append("<td>" + dr.Reporting_Region_Type_Name + "</td>");
                    strExcelContent.Append("</tr>");
                }
            }
            strExcelContent.Append("</tbody></table>");
            System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
            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 subDomin = objCurInfo.GetSubDomain();
            string fileName = "HolidayMaster" + "_" + subDomin + "_" + userName + ".xls";
            string blobUrl  = string.Empty;

            blobUrl = objAzureBlob.AzureBlobUploadText(strExcelContent.ToString(), accKey, fileName, "bulkdatasvc");
            return(blobUrl);
        }
Esempio n. 25
0
        //Insert category//
        public int InsertAPICategory(string CategoryName, string status, string Description)
        {
            DataControl.BLMaster    _objMapping = new DataControl.BLMaster();
            DataControl.CurrentInfo objCurInfo  = new DataControl.CurrentInfo();
            string createdBy   = objCurInfo.GetUserName();
            string createdDate = DateTime.Now.ToString();

            try
            {
                int result = _objMapping.APIInsertCategory(CategoryName, status, createdBy, createdDate, Description);
                return(result);
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:CategoryName", CategoryName);
                dicContext.Add("Filter:Status", status);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return(2);
            }
        }
Esempio n. 26
0
        //UpdateAPIService

        public int UpdateAPIService(string APICategoryCode, string ServiceId, string ServiceDescription, string ServiceType,
                                    string ServiceParamNos, string ServiceParams, string ExcelOutPutHeaders, string ServiceInternalSPName, string serviceTypeMappingClassName,
                                    string serviceName, string IsVisible, string apiID)
        {
            DataControl.BLMaster    _objMapping = new DataControl.BLMaster();
            DataControl.CurrentInfo objCurInfo  = new DataControl.CurrentInfo();
            string createdBy   = objCurInfo.GetUserName();
            string createdDate = DateTime.Now.ToString();

            if (IsVisible == "1")
            {
                IsVisible = "Y";
            }

            try
            {
                int result = _objMapping.UpdateAPIService(APICategoryCode, ServiceId, ServiceDescription, ServiceType, ServiceParamNos,
                                                          ServiceParams, ExcelOutPutHeaders, ServiceInternalSPName, serviceTypeMappingClassName, serviceName, IsVisible, apiID);
                return(result);
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:APICategoryCode", APICategoryCode);
                dicContext.Add("Filter:ServiceId", ServiceId);
                dicContext.Add("Filter:ServiceDescription", ServiceDescription);
                dicContext.Add("Filter:Status", ServiceDescription);
                dicContext.Add("Filter:ServiceType", ServiceType);
                dicContext.Add("Filter:ServiceParamNos", ServiceParamNos);
                dicContext.Add("Filter:ServiceParams", ServiceParams);
                dicContext.Add("Filter:ExcelOutPutHeaders", ExcelOutPutHeaders);
                dicContext.Add("Filter:ServiceInternalSPName", ServiceInternalSPName);
                dicContext.Add("Filter:serviceTypeMappingClassName", serviceTypeMappingClassName);
                dicContext.Add("Filter:serviceName", serviceName);
                dicContext.Add("Filter:IsVisible", IsVisible);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return(2);
            }
        }
Esempio n. 27
0
        //public bool InsertRegionLock(List<RegionLockMappingModel> lstRegionLockMapping)
        //{
        //    bool result = false;
        //    DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
        //    string UserName = objCurInfo.GetUserName();
        //    string CompanyCode = objCurInfo.GetCompanyCode();
        //    string RegionCode = objCurInfo.GetRegionCode();
        //    string RegionTypeCode = null;
        //    //string RegionTypeCode = lstRegionLockMapping[i].Region_Type_Code;
        //    result = _objBLRegion.InsertRegionLockMapping(lstRegionLockMapping, CompanyCode, RegionCode, RegionTypeCode, UserName);
        //    return result;
        //}

        public bool InsertRegionLock(string regionLockJson)
        {
            try
            {
                _objcurrentInfo = new CurrentInfo();
                _objBLRegion    = new BLRegion();
                DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
                string UserName    = objCurInfo.GetUserName();
                string CompanyCode = objCurInfo.GetCompanyCode();
                // RegionCode = objCurInfo.GetRegionCode();

                // string company_Code = _objcurrentInfo.GetCompanyCode();
                return(_objBLRegion.InsertRegionLockMapping(CompanyCode, UserName, regionLockJson));
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("region Lock Json:", regionLockJson);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                throw;
            }
        }
Esempio n. 28
0
        public int UpdateAPICategory(string CategoryName, string status, string description, string APIcategoryID)
        {
            DataControl.BLMaster    _objMapping = new DataControl.BLMaster();
            DataControl.CurrentInfo objCurInfo  = new DataControl.CurrentInfo();
            string createdBy   = objCurInfo.GetUserName();
            string createdDate = DateTime.Now.ToString();

            try
            {
                int result = _objMapping.UpdateAPICategory(CategoryName, status, createdBy, createdDate, description, APIcategoryID);
                return(result);
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();

                dicContext.Add("Filter:requestCode", status);
                dicContext.Add("Filter:userTypeCode", APIcategoryID);

                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return(2);
            }
        }
Esempio n. 29
0
        public string GetEmployeeAuditReport(string fromDate, string toDate, string isExcel)
        {
            StringBuilder strContent = new StringBuilder();
            string        blobUrl    = string.Empty;

            strContent.Append("<table><tr><td colspan='7'  class='tblhead'>Employee Audit Report - 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'  id='tblEmployee'><thead><tr><th>S.No</th><th>Date</th><th>Employee Name </th><th>Employee Number</th>");
            strContent.Append("<th>Gender</th><th>Date of birth</th><th>Address</th><th>Phone</th><th>Mobile</th>");
            strContent.Append("<th>Employee Status</th><th>Email Id</th><th>Date of Joining</th><th>EDN Proof</th><th>Salary Proof</th>");
            strContent.Append("<th>Resume Given</th><th>Resignation Submitted</th><th>Appointed</th><th>Bank Account Number1</th><th>Bank Account Number2</th>");
            strContent.Append("<th>PF Number</th><th>PAN Number</th><th>Effective From</th><th>Effective To</th><th>Confirmation Date</th>");
            strContent.Append("<th>Employee Entity Type</th><th>Created By</th><th>Created DateTime</th>");
            strContent.Append("<th>Updated By</th><th>Updated DateTime</th></tr></thead><tbody>");
            try
            {
                DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
                DataControl.BLUser      objUser    = new DataControl.BLUser();
                List <MVCModels.HiDoctor_Master.EmployeeModel> lstEmp =
                    new List <MVCModels.HiDoctor_Master.EmployeeModel>(objUser.GetEmployeeAuditReport(objCurInfo.GetCompanyCode(), fromDate, toDate));
                int i = 0;
                if (lstEmp.Count > 0)
                {
                    foreach (var dr in lstEmp)
                    {
                        i++;
                        strContent.Append("<tr><td>" + i + "</td>");
                        strContent.Append("<td>" + Convert.ToString(dr.Updated_DateTime).Substring(0, 10) + "</td>");
                        strContent.Append("<td>" + dr.Employee_Name + "</td>");
                        strContent.Append("<td>" + dr.Employee_Number + "</td>");
                        strContent.Append("<td>" + dr.Gender + "</td>");
                        if (dr.Date_Of_Birth == "01/01/1900")
                        {
                            strContent.Append("<td></td>");
                        }
                        else
                        {
                            strContent.Append("<td>" + dr.Date_Of_Birth + "</td>");
                        }
                        //strContent.Append("<td>" + dr.Date_Of_Birth + "</td>");
                        strContent.Append("<td>" + dr.Address + "</td>");
                        strContent.Append("<td>" + dr.Phone + "</td>");
                        strContent.Append("<td>" + dr.Mobile + "</td>");
                        strContent.Append("<td>" + dr.Employee_Status + "</td>");
                        strContent.Append("<td>" + dr.Email_Id + "</td>");
                        if (dr.Date_of_Joining == "01/01/1900")
                        {
                            strContent.Append("<td></td>");
                        }
                        else
                        {
                            strContent.Append("<td>" + dr.Date_of_Joining + "</td>");
                        }

                        strContent.Append("<td>" + ((dr.EDN_Proof == "0") ? "No" : "Yes") + "</td>");
                        strContent.Append("<td>" + ((dr.Salary_Proof == "0") ? "No" : "Yes") + "</td>");
                        strContent.Append("<td>" + ((dr.Resume_Given == "0") ? "No" : "Yes") + "</td>");
                        strContent.Append("<td>" + ((dr.Resignation_Submitted == "0") ? "No" : "Yes") + "</td>");
                        strContent.Append("<td>" + ((dr.Appointed == "0") ? "No" : "Yes") + "</td>");
                        strContent.Append("<td>" + dr.SCB_Account_Number + "</td>");
                        strContent.Append("<td>" + dr.ICICI_Account_Number + "</td>");
                        strContent.Append("<td>" + dr.PF_Number + "</td>");
                        strContent.Append("<td>" + dr.PAN_Number + "</td>");
                        if (dr.Effective_From == "01/01/1900")
                        {
                            strContent.Append("<td></td>");
                        }
                        else
                        {
                            strContent.Append("<td>" + dr.Effective_From + "</td>");
                        }
                        if (dr.Effective_To == "01/01/1900")
                        {
                            strContent.Append("<td></td>");
                        }
                        else
                        {
                            strContent.Append("<td>" + dr.Effective_To + "</td>");
                        }
                        if (dr.Confirmation_Date == "01/01/1900")
                        {
                            strContent.Append("<td></td>");
                        }
                        else
                        {
                            strContent.Append("<td>" + dr.Confirmation_Date + "</td>");
                        }
                        strContent.Append("<td>" + dr.Employee_Entity_Type + "</td>");
                        strContent.Append("<td>" + dr.Created_By + "</td>");
                        if (dr.Created_DateTime == "01/01/1900")
                        {
                            strContent.Append("<td></td>");
                        }
                        else
                        {
                            strContent.Append("<td>" + dr.Created_DateTime + "</td>");
                        }
                        strContent.Append("<td>" + dr.Updated_By + "</td>");
                        if (dr.Updated_DateTime == "01/01/1900")
                        {
                            strContent.Append("<td></td>");
                        }
                        else
                        {
                            strContent.Append("<td>" + dr.Updated_DateTime + "</td>");
                        }
                        strContent.Append("</tr>");
                    }
                }
                else
                {
                    strContent.Append("<tr><td colspan='29' style='text-align:center;'>No records found</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 = "EMPLOYEEAUDITREPORT_" + "_" + 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());
        }
Esempio n. 30
0
        ///// <summary>
        ///// Get TP Master report for alumini users
        ///// </summary>
        ///// <param name="userCode"></param>
        ///// <param name="date"></param>
        ///// <returns>return the table content</returns>
        public string GetTPMasterReportForAluminiUsers(string userCode, string month, string year, string isExcel, string monthName)
        {
            StringBuilder strContent = new StringBuilder();

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            DataControl.BL_Report   objReport  = new DataControl.BL_Report();
            DataControl.BLUser      objUser    = new DataControl.BLUser();
            #region tp header
            strContent.Append(objUser.GetReportHeaderTableString(objCurInfo.GetCompanyCode(), userCode, monthName + "-" + year, "", "", ""));
            strContent.Append("<table class='table table-striped' cellpadding=0 cellspacing=0  id ='tblTPReport'>");
            strContent.Append("<thead>");
            strContent.Append("<tr id='tblTr'>");
            strContent.Append("<th>User Name</th>");
            strContent.Append("<th>TP Date</th>");
            strContent.Append("<th>Call Objective</th>");
            strContent.Append("<th>Activity Name</th>");
            strContent.Append("<th>Category</th>");
            strContent.Append("<th>CP Name</th>");
            strContent.Append("<th>Meeting Point </th>");
            strContent.Append("<th>Meeting Time </th>");
            strContent.Append("<th>Work Place</th>");
            strContent.Append("<th>SFC</th>");
            strContent.Append("<th>Accomp Name</th>");
            strContent.Append("<th>No oF Planned Doctors</th>");
            strContent.Append("<th>Entered Date</th>");
            strContent.Append("<th>Entered By</th>");
            strContent.Append("<th>Remarks</th>");
            strContent.Append("<th>Status</th>");
            strContent.Append("<th>Approved/Unapproved Date</th>");
            strContent.Append("<th>Approve/Unapprove Reason</th>");
            strContent.Append("</tr>");
            strContent.Append("</thead>");
            strContent.Append("<tbody>");
            #endregion tp header
            try
            {
                DataSet ds = new DataSet();
                ds = objReport.GetTPMasterReportForAlumniUsers(objCurInfo.GetCompanyCode(), month, year, userCode);
                if (ds.Tables.Count > 0)
                {
                    int      noOfDays    = System.DateTime.DaysInMonth(Convert.ToInt32(year), Convert.ToInt32(month));
                    DateTime startDate   = Convert.ToDateTime(year + "-" + month + "-01");
                    DateTime endDate     = Convert.ToDateTime(year + "-" + month + "-" + noOfDays);
                    DateTime dtStartDate = new DateTime();
                    DateTime dtEndDate   = new DateTime();
                    dtStartDate = Convert.ToDateTime(startDate);
                    dtEndDate   = Convert.ToDateTime(endDate);
                    DateTime dtDate = dtStartDate;
                    TimeSpan ts;
                    ts = dtEndDate - dtStartDate;
                    for (var j = 0; j <= ts.Days; j++)
                    {
                        if (j != 0)
                        {
                            dtDate = dtDate.AddDays(Convert.ToDouble(1));
                        }

                        DataRow[] dr = ds.Tables[0].AsEnumerable().Where(a => Convert.ToInt32(a["Day"]) == dtDate.Day &&
                                                                         Convert.ToInt32(a["Month"]) == dtDate.Month && Convert.ToInt32(a["Year"]) == dtDate.Year).ToArray();

                        if (dr.Length > 0)
                        {
                            strContent.Append("<tr>");
                            strContent.Append("<td>" + Convert.ToString(dr[0]["User_Name"]) + "</td>");
                            strContent.Append("<td>" + Convert.ToString(dr[0]["TP_Date"]) + "</td>");


                            strContent.Append("<td>" + Convert.ToString(dr[0]["Activity_Code"]) + "</td>");


                            strContent.Append("<td>" + Convert.ToString(dr[0]["Project_Code"]) + "</td>");


                            strContent.Append("<td>" + Convert.ToString(dr[0]["Category"]) + "</td>");


                            strContent.Append("<td>" + Convert.ToString(dr[0]["CP_name"]) + "</td>");
                            strContent.Append("<td>" + Convert.ToString(dr[0]["Meeting_point"]) + "</td>");
                            strContent.Append("<td>" + Convert.ToString(dr[0]["Meeting_Time"]) + "</td>");

                            strContent.Append("<td>" + Convert.ToString(dr[0]["Work_Area"]) + "</td>");

                            #region TP SFC details
                            //  var sfcDet = jsonPath(jsData, "$.Tables[4].Rows[?(@.TP_Id=='" + details[0].TP_Id + "')]");
                            DataRow[]     drSFC  = ds.Tables[2].AsEnumerable().Where(z => Convert.ToString(z["TP_Id"]) == Convert.ToString(dr[0]["TP_Id"])).ToArray();
                            StringBuilder strSFC = new StringBuilder();

                            if (drSFC.Length > 0)
                            {
                                for (int s = 0; s < drSFC.Length; s++)
                                {
                                    if (!string.IsNullOrEmpty(Convert.ToString(drSFC[s]["From_Place"])))
                                    {
                                        strSFC.Append("" + (s + 1) + "/ " + Convert.ToString(drSFC[s]["From_Place"]) + "  to  "
                                                      + Convert.ToString(drSFC[s]["To_Place"]) + "<br />");
                                    }
                                }
                            }
                            strContent.Append("<td>" + strSFC.ToString() + "</td>");
                            #endregion TP SFC details
                            StringBuilder strAccName = new StringBuilder();
                            if (!string.IsNullOrEmpty(Convert.ToString(dr[0]["Accomp_Name"])))
                            {
                                strAccName.Append("" + Convert.ToString(dr[0]["Accomp_Name"]) + " <br />");
                            }
                            if (!string.IsNullOrEmpty(Convert.ToString(dr[0]["Accompanist2_Name"])))
                            {
                                strAccName.Append("" + Convert.ToString(dr[0]["Accompanist2_Name"]) + "<br />");
                            }
                            if (!string.IsNullOrEmpty(Convert.ToString(dr[0]["Accompanist3_Name"])))
                            {
                                strAccName.Append("" + Convert.ToString(dr[0]["Accompanist3_Name"]) + "<br />");
                            }
                            if (!string.IsNullOrEmpty(Convert.ToString(dr[0]["Accompanist4_Name"])))
                            {
                                strAccName.Append("" + Convert.ToString(dr[0]["Accompanist4_Name"]) + "<br /> ");
                            }

                            strContent.Append("<td>" + strAccName.ToString() + "</td>");
                            DataRow[] drDoctors = ds.Tables[1].AsEnumerable().Where(c => Convert.ToString(c["TP_Date"]) ==
                                                                                    Convert.ToString(dr[0]["TP_Date"])).ToArray();


                            if (drDoctors.Length > 0)
                            {
                                // content += "<td>" + dJsonData.length + "</td>";
                                strContent.Append("<td align='center' ><span onclick='fnTPDetails(\"" + userCode + "_"
                                                  + dr[0]["TP_Date"] + "\")' style='text-decoration:underline;cursor:pointer'>" + drDoctors.Length + "</span></td>");
                            }
                            else
                            {
                                strContent.Append("<td></td>");
                            }


                            strContent.Append("<td>" + Convert.ToString(dr[0]["Entered_Date"]) + "</td>");

                            strContent.Append("<td>" + Convert.ToString(dr[0]["Entered_by"]) + "</td>");



                            strContent.Append("<td>" + Convert.ToString(dr[0]["Remarks"]) + "</td>");



                            strContent.Append("<td>" + Convert.ToString(dr[0]["Status"]) + "</td>");


                            strContent.Append("<td>" + Convert.ToString(dr[0]["Approved_Date"]) + "</td>");



                            strContent.Append("<td>" + Convert.ToString(dr[0]["Unapprove_Reason"]) + "</td>");


                            strContent.Append("</tr>");
                        }
                        else
                        {
                            #region holiday details
                            DataRow[] drHoliday = ds.Tables[3].AsEnumerable().Where(a => Convert.ToInt32(a["Day"]) == dtDate.Day &&
                                                                                    Convert.ToInt32(a["Month"]) == dtDate.Month && Convert.ToInt32(a["Year"]) == dtDate.Year).ToArray();
                            // var details = jsonPath(jsData, "$.Tables[5].Rows[?(@.Day=='" + day + "' & @.Month=='" + month + "' & @.Year=='" + year + "')]");
                            if (drHoliday.Length > 0)
                            {
                                if (Convert.ToString(drHoliday[0]["Type"]) == "S")
                                {
                                    strContent.Append("<tr>");
                                    strContent.Append("<td style='background: #efefef;'></td>");


                                    strContent.Append("<td style='background: #efefef;'>" + Convert.ToString(drHoliday[0]["Date"]) + "</td>");

                                    strContent.Append("<td style='background: #efefef;'> - Sunday</td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");

                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");

                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");

                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("</tr>");
                                }
                                else
                                {
                                    strContent.Append("<tr>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'>" + Convert.ToString(drHoliday[0]["Date"]) + "</td>");
                                    strContent.Append("<td style='background: #efefef;'> - Holiday - </td>");

                                    strContent.Append("<td style='background: #efefef;'>" + Convert.ToString(drHoliday[0]["Holiday"]) + "</td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");

                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");

                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");

                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("<td style='background: #efefef;'></td>");
                                    strContent.Append("</tr>");
                                }
                            }
                            #endregion holiday details
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }

            strContent.Append("</tbody>");
            strContent.Append("</table>");
            string blobUrl = string.Empty;
            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 = "TPMASTERALUMINI_" + "_" + compCode + "_" + userName + ".xls";
                blobUrl = objAzureBlob.AzureBlobUploadText(strContent.ToString(), accKey, fileName, "bulkdatasvc");
                strContent.Clear();
                strContent.Append(blobUrl);
            }
            return(strContent.ToString());
        }