Beispiel #1
0
        public string Index(FormCollection form)
        {
            string             result = "";
            HttpPostedFileBase file   = Request.Files[0];

            DataControl.CurrentInfo _objCurInfo   = new DataControl.CurrentInfo();
            MVCModels.RCPA_Header   objrcpaHeader = new MVCModels.RCPA_Header();
            objrcpaHeader.Company_Id   = Convert.ToInt32(_objCurInfo.GetCompanyId());
            objrcpaHeader.Company_code = _objCurInfo.GetCompanyCode();
            objrcpaHeader.user_code    = _objCurInfo.GetUserCode();
            // objrcpaHeader.Region_Code = _objCurInfo.GetRegionCode();
            // objrcpaHeader.PeriodTo = DateTime.Now;
            //objrcpaHeader.PeriodFrom = DateTime.Now;
            try
            {
                DateTime dt = DateTime.ParseExact(Request.Form["txtPeriodFrom"].ToString(), "dd/MM/yyyy", CultureInfo.InvariantCulture);
                objrcpaHeader.PeriodFrom = Convert.ToDateTime(dt.ToString("yyyy-MM-dd"));
                dt = DateTime.ParseExact(Request.Form["txtPeriodTo"].ToString(), "dd/MM/yyyy", CultureInfo.InvariantCulture);
                objrcpaHeader.PeriodTo    = Convert.ToDateTime(dt);
                objrcpaHeader.Region_Code = Request.Form["hdnRegion_Code"].ToString();
                string subDomain = _objCurInfo.GetSubDomain();
                result            = _objBLRCPACompetator.RCPAExcelBulkAddResult(subDomain, _objCurInfo.GetCompanyCode(), _objCurInfo.GetRegionCode(), Guid.NewGuid().ToString(), file, _objCurInfo.GetUserCode(), objrcpaHeader);
                ViewBag.ErrorCode = result;
                DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
                ViewBag.Companycode = objCurInfo.GetCompanyCode();
                ViewBag.RegionCode  = objCurInfo.GetRegionCode();
            }
            catch (Exception ex)
            {
                result = ex.Message;
            }
            return(result);
        }
Beispiel #2
0
 public ActionResult RCPABatchIndex()
 {
     DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
     ViewBag.Companycode = objCurInfo.GetCompanyCode();
     ViewBag.ErrorCode   = "";
     return(View());
 }
Beispiel #3
0
        public string GetUserType()
        {
            DataControl.CurrentInfo _objCurInfo = new DataControl.CurrentInfo();
            string getusertypename = _objCurInfo.GetUserTypeName();

            return(getusertypename);
        }
Beispiel #4
0
        public string GetDoctorSufPreColumns()
        {
            IConfigSettings IConfig_Settings = new Config_Settings();

            _objCurrentInfo = new CurrentInfo();
            return(IConfig_Settings.GetConfigDefaultValue(_objCurrentInfo.GetCompanyCode(), CONFIG_TYPE.DCR, CONFIG_KEY.DCR_DOCTOR_SUFIX_COLUMNS));
        }
Beispiel #5
0
 public ActionResult Index()
 {
     _objCurrentInfo      = new CurrentInfo();
     ViewBag.Company_Code = _objCurrentInfo.GetCompanyCode();
     ViewBag.User_Code    = _objCurrentInfo.GetUserCode();
     return(View());
 }
Beispiel #6
0
        public int GetDCREntryBasedOnPrivilege(string dcrDate, string flag)
        {
            int result = 1;

            try
            {
                _objSPData      = new SPData();
                _objcurrentInfo = new CurrentInfo();

                string company_Code = _objcurrentInfo.GetCompanyCode();
                string user_Code    = _objcurrentInfo.GetUserCode();
                if (flag == "FIELD" || flag == "FIELD_RCPA")
                {
                    flag = "F";
                }
                else if (flag == "ATTENDANCE")
                {
                    flag = "A";
                }
                else
                {
                    flag = "L";
                }
                result = _objSPData.GetDCREntryBasedOnPrivilege(company_Code, user_Code, dcrDate, flag);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Beispiel #7
0
        public string TypeInsert(FormCollection collection)
        {
            string strQry       = string.Empty;
            string result       = string.Empty;
            string expenseGroup = collection["ExpenseGroup"];
            int    rowCount     = int.Parse(collection["rowCount"]);
            string type         = collection["Type"];

            DataControl.CurrentInfo _ObjCurInfo        = new DataControl.CurrentInfo();
            Models.ExpensesMapping  objExpensesMapping = new Models.ExpensesMapping();
            if (type == "Region")
            {
                for (int i = 1; i <= rowCount - 1; i++)
                {
                    strQry += "Exec SP_hdUpdateExpenseGroupInRegionMaster '" + collection["cbk_" + i.ToString()] + "','" + expenseGroup + "','" + collection["Checked_" + i.ToString()] + "','" + _ObjCurInfo.GetCompanyCode() + "';";
                    //objExpensesMapping.RegionExpenseInsert(collection["cbk_" + i.ToString()], ExpenseGroup, collection["Checked_" + i.ToString()]);
                }
                result = objExpensesMapping.ExpenseMappingInsert(strQry);
            }
            else if (type == "User")
            {
                for (int i = 1; i <= rowCount - 1; i++)
                {
                    strQry += "Exec SP_hdUpdateExpenseGroupInUserMaster '" + collection["cbk_" + i.ToString()] + "','" + expenseGroup + "','" + collection["Checked_" + i.ToString()] + "','" + _ObjCurInfo.GetCompanyCode() + "';";
                    //objExpensesMapping.UserExpenseInsert(collection["cbk_" + i.ToString()], ExpenseGroup, collection["Checked_" + i.ToString()]);
                }
                result = objExpensesMapping.ExpenseMappingInsert(strQry);
            }
            return(result);
        }
Beispiel #8
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());
            }
        }
Beispiel #9
0
        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());
            }
        }
Beispiel #10
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);
            }
        }
Beispiel #11
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);
        }
Beispiel #12
0
        public string GetRegionsForHolidaySearch()
        {
            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            DataControl.BLRegion    objRegion  = new DataControl.BLRegion();
            IEnumerable <MVCModels.HiDoctor_Master.RegionModel> lstRegion         = null;
            IEnumerable <MVCModels.HiDoctor_Master.RegionModel> lstUnMappedRegion = null;

            lstRegion         = objRegion.GetHolidayMappedRegions(objCurInfo.GetCompanyCode());
            lstUnMappedRegion = objRegion.GetHolidayUnMappedRegions(objCurInfo.GetCompanyCode());
            StringBuilder strContent = new StringBuilder();

            strContent.Append("<table class='table table-striped' id='tblUnMappedRegion'><thead><tr><td>S.No</td><td><input type='checkbox' name='chkAllUnMappedRegion' onclick='fnSelectAllUnMappedRegions();'/></td>");
            strContent.Append("<td>Region Name</td><td>Region Type</td><td>Reporting Region</td><td>Reporting Region Type</td></tr></thead>");
            if (lstUnMappedRegion != null)
            {
                int i = 0;
                foreach (var dr in lstUnMappedRegion)
                {
                    i++;
                    strContent.Append("<tr><td>" + i + "</td>");
                    strContent.Append("<td><input type='checkbox' id='chkSelect_" + i + "' name='chkUnMappedRegion' value='" + dr.Region_Code + "'/></td>");
                    strContent.Append("<td>" + dr.Region_Name + "</td>");
                    strContent.Append("<td>" + dr.Region_Type_Name + "</td>");
                    strContent.Append("<td>" + dr.Reporting_Region_Name + "</td>");
                    strContent.Append("<td>" + dr.Reporting_Region_Type_Name + "</td>");
                    strContent.Append("</tr>");
                }
            }
            strContent.Append("</table>");
            DataControl.JSONConverter objJson = new DataControl.JSONConverter();
            return(objJson.Serialize(lstRegion) + "~" + strContent.ToString());
        }
Beispiel #13
0
        public string GetSearchHolidayDetails(string holidayDate)
        {
            int count = 0;

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            DataControl.BLRegion    objRegion  = new DataControl.BLRegion();
            IEnumerable <MVCModels.HiDoctor_Master.HolidayModel> lstHoliday = null;
            string date = holidayDate.Split('/')[2] + "-" + holidayDate.Split('/')[1] + "-" + holidayDate.Split('/')[0];

            lstHoliday = objRegion.GetHolidayDetailsByDate(objCurInfo.GetCompanyCode(), date);
            StringBuilder strContent = new StringBuilder();

            strContent.Append("<table class='table table-striped'><thead><tr><td>S.No</td><td>Date</td><td>Holiday Name</td>");
            strContent.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++;
                    strContent.Append("<tr><td>" + i + "</td>");
                    strContent.Append("<td>" + dr.Holiday_Date + "</td>");
                    strContent.Append("<td>" + dr.Holiday_Name + "</td>");
                    strContent.Append("<td>" + dr.Region_Name + "<input type='hidden' id='hdnRegionCode_" + i + "' value='" + dr.Region_Code + "'/></td>");
                    strContent.Append("<td>" + dr.Region_Type_Name + "</td>");
                    strContent.Append("<td>" + dr.Reporting_Region_Name + "</td>");
                    strContent.Append("<td>" + dr.Reporting_Region_Type_Name + "</td>");
                    strContent.Append("</tr>");
                }
            }
            strContent.Append("</tbody></table>");
            return(strContent.ToString());
        }
Beispiel #14
0
        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.");
            }
        }
Beispiel #15
0
        public string GetLeaveEntryMode()
        {
            _objcurrentInfo = new CurrentInfo();
            string Leave_Entry_Mode = _objcurrentInfo.GetPrivilegeValue("LEAVE_ENTRY_MODE", "FULL_DAY");

            return(Leave_Entry_Mode);
        }
Beispiel #16
0
        public string UpdateMsgReadStatus(string isRead, string msgDetails)
        {
            string result = string.Empty;
            List <MVCModels.MessagingModel> lstMsg = new List <MVCModels.MessagingModel>();

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            DataControl.BLMessaging objMsg     = new DataControl.BLMessaging();
            try
            {
                if (!string.IsNullOrEmpty(msgDetails))
                {
                    string[] ar = msgDetails.Split('^');
                    if (ar.Length > 0)
                    {
                        for (int i = 0; i < ar.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(Convert.ToString(ar[i]).Split('~')[0]))
                            {
                                string targetAddress = Convert.ToString(ar[i]).Split('~')[1];
                                MVCModels.MessagingModel objMsgModel = new MVCModels.MessagingModel();
                                objMsgModel.Company_Code   = objCurInfo.GetCompanyCode();
                                objMsgModel.Msg_Code       = Convert.ToString(ar[i]).Split('~')[0];
                                objMsgModel.Target_Address = targetAddress;
                                lstMsg.Add(objMsgModel);
                            }
                        }
                        int rowsAffected = 0;
                        rowsAffected = objMsg.UpdateMsgReadStatus(objCurInfo.GetCompanyCode(), lstMsg, isRead);
                        if (rowsAffected > 0)
                        {
                            if (isRead == "1")
                            {
                                result = "The conversation has been marked as read.";
                            }
                            else
                            {
                                result = "The conversation has been marked as unread.";
                            }
                        }
                        else
                        {
                            if (isRead == "1")
                            {
                                result = "Error while change the conversation as read.";
                            }
                            else
                            {
                                result = "Error while change the conversation as unread.";
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                DataControl.Impl.ExceptionHandler.WriteLog(ex: ex, dic: dicObj);
            }
            return(result);
        }//The conversation has been moved to the Trash.
Beispiel #17
0
        public JsonResult CheckTPAvailableForSelectedDCRDates(string DCRDates)
        {
            try
            {
                _objSPData      = new SPData();
                _objcurrentInfo = new CurrentInfo();

                string company_Code = _objcurrentInfo.GetCompanyCode();
                string user_Code    = _objcurrentInfo.GetUserCode();
                string region_Code  = _objcurrentInfo.GetRegionCode();

                List <string> lstDCRDates = _objSPData.CheckTPAvailableForSelectedDCRDates(company_Code, user_Code, region_Code, DCRDates);

                // List<string> DCR_Dates = DCRDates.Split('^').ToList();
                // DCR_Dates = DCR_Dates.Where(d => d != "").ToList();
                // //compare two list and return not matching items using linq
                //List<string> lstDCRDatesWithoutPlan =  DCR_Dates.Except(lstDCRDates).ToList();
                if (lstDCRDates != null)
                {
                    return(Json(lstDCRDates));
                }
                return(null);
            }
            catch
            {
                throw;
            }
        }
Beispiel #18
0
        /// <summary>
        /// Get the all type message count
        /// </summary>
        /// <returns>retuns the unread, drafted and trash count</returns>
        public string GetMsgCount()
        {
            string unreadCount  = string.Empty;
            string draftedCount = string.Empty;
            string trashCount   = string.Empty;

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            DataControl.BLMessaging objMsg     = new DataControl.BLMessaging();
            try
            {
                DataSet ds = new DataSet();
                ds = objMsg.GetMessageCount(objCurInfo.GetCompanyCode(), objCurInfo.GetUserCode());
                if (ds.Tables.Count > 0)
                {
                    unreadCount = Convert.ToString(ds.Tables[0].Rows[0][0]);
                    if (ds.Tables.Count > 1)
                    {
                        draftedCount = Convert.ToString(ds.Tables[1].Rows[0][0]);
                        if (ds.Tables.Count > 2)
                        {
                            trashCount = Convert.ToString(ds.Tables[2].Rows[0][0]);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                DataControl.Impl.ExceptionHandler.WriteLog(ex, null);
            }
            return(unreadCount + "~" + draftedCount + "~" + trashCount);
        }
Beispiel #19
0
        /// <summary>
        /// Payslip inheritance
        /// </summary>
        /// <param name="sourceUserTypeCode"></param>
        /// <param name="userTypes"></param>
        /// <returns>copy the payslip meta data from the source region to destination region</returns>
        public int PaySlipInheritance(string sourceUserTypeCode, string userTypes)
        {
            int rowsAffected = 0;

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            DataControl.BLUser      objUser    = new DataControl.BLUser();
            try
            {
                List <MVCModels.HiDoctor_Master.UserTypeModel> lstUserTypes = new List <MVCModels.HiDoctor_Master.UserTypeModel>();
                if (!string.IsNullOrEmpty(userTypes))
                {
                    string[] arUserTypes;
                    arUserTypes = userTypes.Split('^');
                    for (int i = 0; i < arUserTypes.Length; i++)
                    {
                        if (!string.IsNullOrEmpty(arUserTypes[i]))
                        {
                            MVCModels.HiDoctor_Master.UserTypeModel objUserType = new MVCModels.HiDoctor_Master.UserTypeModel();
                            objUserType.User_Type_Code = Convert.ToString(arUserTypes[i]);
                            objUserType.Company_Code   = objCurInfo.GetCompanyCode();
                            lstUserTypes.Add(objUserType);
                        }
                    }
                }
                rowsAffected = objUser.PaySlipInheritance(objCurInfo.GetCompanyCode(), sourceUserTypeCode, lstUserTypes);
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                dicObj.Add("sourceUserTypeCode", sourceUserTypeCode);
                dicObj.Add("userTypes", userTypes);
                DataControl.Impl.ExceptionHandler.WriteLog(ex: ex, dic: dicObj);
            }
            return(rowsAffected);
        }
Beispiel #20
0
        public string UpdateAttachmentPath(string msgCode, string fileName, string columnName, string fileRemoved)
        {
            string result = string.Empty;

            try
            {
                DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
                DataControl.BLMessaging objMsg     = new DataControl.BLMessaging();
                int rowsAffected = objMsg.UpdateAttachmentPath(objCurInfo.GetCompanyCode(), fileName, columnName, msgCode, fileRemoved);
                if (rowsAffected > 0)
                {
                    result = "SUCCESS:";
                }

                else
                {
                    result = "ERROR:";
                }
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                DataControl.Impl.ExceptionHandler.WriteLog(ex: ex, dic: dicObj);
                result = "Sorry. Error while update the attachment file ...";
            }
            return(result);
        }
Beispiel #21
0
        /// <summary>
        /// Insert User ProductMapping
        /// </summary>
        /// <param name="userCodes"></param>
        /// <param name="productCodes"></param>
        /// <returns></returns>
        public string InsertUserProductMapping(string userCodes, string productCodes)
        {
            int result = 0;

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            string        companyCode          = _objcurrentInfo.GetCompanyCode();
            BLMaster      _objMaster           = new BLMaster();
            StringBuilder strBuild             = new StringBuilder();
            string        currentDate          = DateTime.Now.ToString("yyyy-MM-dd");

            try
            {
                result = _objMaster.InsertUserProduct(companyCode, userCodes, productCodes, currentDate);
                if (result > 0)
                {
                    strBuild.Append("User Product Mapped Sucessfully.");
                }
                else
                {
                    strBuild.Append("This User Product Already Mapped");
                }
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("userCodes", userCodes);
                dicContext.Add("productCodes", productCodes);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                return(null);
            }
            return(strBuild.ToString());
        }
Beispiel #22
0
 public ActionResult OBOUserRegionMapping()
 {
     DataControl.CurrentInfo _objcurrentInfo = new DataControl.CurrentInfo();
     ViewBag.Cur_Region_Code = _objcurrentInfo.GetRegionCode();
     ViewBag.Cur_User_Code   = _objcurrentInfo.GetUserCode();
     return(View());
 }
Beispiel #23
0
 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");
     }
 }
Beispiel #24
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());
 }
Beispiel #25
0
        public JsonResult GetUserTypeActivityMap()
        {
            DataControl.BLUser      _objBluser      = new DataControl.BLUser();
            DataControl.CurrentInfo _objCurrentInfo = new DataControl.CurrentInfo();

            return(Json(_objBluser.GetUserTypeActivityMapdata(_objCurrentInfo.GetCompanyCode()), JsonRequestBehavior.AllowGet)); //GetUserTypeActivityMaptable(ds);
        }
Beispiel #26
0
        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."));
            }
        }
Beispiel #27
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);
        }
Beispiel #28
0
        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);
            }
        }
Beispiel #29
0
        public string GetUnderUserTypes()
        {
            StringBuilder strContent = new StringBuilder();

            try
            {
                DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
                string userCode    = objCurInfo.GetUserCode();
                string companyCode = objCurInfo.GetCompanyCode();
                List <MVCModels.HiDoctor_Master.UserTypeModel> lstUserType = new List <MVCModels.HiDoctor_Master.UserTypeModel>();
                lstUserType = _objBLDcrStatusMaster.GetUnderUserTypes(companyCode, userCode).ToList();
                strContent.Append("<option value=''>-Select User Type-</option>");
                if (lstUserType.Count > 0)
                {
                    foreach (var dr in lstUserType)
                    {
                        strContent.Append("<option value='" + dr.User_Type_Code + "'>" + dr.User_Type_Name + "</option>");
                    }
                }
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                DataControl.Impl.ExceptionHandler.WriteLog(ex: ex, dic: dicObj);
            }
            return(strContent.ToString());
        }
Beispiel #30
0
        /// <summary>
        /// Retrieve the KYD List.
        /// </summary>
        /// <param name="dcrDate"></param>
        /// <param name="Key_Column"></param>
        /// <returns></returns>
        public List <KYDModel> GetKYDCustomerList(string dcrDate, string Key_Column)
        {
            try
            {
                // Creates instance.
                _blKYD   = new BL_KYD();
                _objCurr = new CurrentInfo();

                string company_Code = _objCurr.GetCompanyCode();
                string user_Code    = _objCurr.GetUserCode();

                // Reterievs the KYD Customer list.
                IEnumerable <KYDModel> IlstKYDCustomers = _blKYD.GetKYDCustomerList(company_Code, user_Code, dcrDate, Key_Column);
                if (IlstKYDCustomers != null)
                {
                    List <KYDModel> lstKYDCustomers = IlstKYDCustomers.ToList();

                    return(lstKYDCustomers);
                }
                else
                {
                    return(null);
                }
            }
            catch
            {
                throw;
            }
        }