Ejemplo n.º 1
0
 //Beat Plan Creation Screen
 public ActionResult CreateBeatPlan()
 {
     ViewBag.Company_Code   = _objCurrentInfo.GetCompanyCode();
     ViewBag.Company_Id     = _objCurrentInfo.GetCompanyId();
     ViewBag.Region_Code    = _objCurrentInfo.GetRegionCode();
     ViewBag.User_Code      = _objCurrentInfo.GetUserCode();
     ViewBag.User_Type_Code = _objCurrentInfo.GetUserTypeCode();
     return(View());
 }
Ejemplo n.º 2
0
 public ActionResult DailyReporting(string dcrActualDate)
 {
     ViewBag.CompanyCode  = _objCurrentInfo.GetCompanyCode();
     ViewBag.RegionCode   = _objCurrentInfo.GetRegionCode();
     ViewBag.UserCode     = _objCurrentInfo.GetUserCode();
     ViewBag.UserTypeCode = _objCurrentInfo.GetUserTypeCode();
     ViewBag.dcrdate      = dcrActualDate;
     ViewBag.UserName     = _objCurrentInfo.GetUserName();
     ViewBag.RegionName   = _objCurrentInfo.GetRegionName();
     return(View());
 }
Ejemplo n.º 3
0
 public ActionResult Index(string dcrActualDate, string flag, string Company_Code, string UserCode, string RegionCode, int CompanyId)
 {
     GetPrivillegeValue();
     ViewBag.DCRActualDate    = dcrActualDate;
     ViewBag.Flag             = flag;
     ViewBag.doctor_caption   = DOCTOR_CAPTION;
     ViewBag.chemist_caption  = CHEMIST_CAPTION;
     ViewBag.stockist_caption = STOCKIEST_CAPTION;
     ViewBag.Company_Code     = _objCurrentInfo.GetCompanyCode();
     ViewBag.UserCode         = _objCurrentInfo.GetUserCode();
     ViewBag.RegionCode       = _objCurrentInfo.GetRegionCode();
     ViewBag.CompanyId        = _objCurrentInfo.GetCompanyId();
     return(View());
 }
Ejemplo n.º 4
0
        //
        // GET: /Messaging/

        public ActionResult Index()
        {
            DataControl.CurrentInfo objCurInfo = new CurrentInfo();
            ViewBag.CurrentUserCode   = objCurInfo.GetUserCode();
            ViewBag.CurrentRegionCode = objCurInfo.GetRegionCode();
            return(View());
        }
Ejemplo n.º 5
0
        public ActionResult SecondarySalesDelete()
        {
            CurrentInfo _objCunr = new CurrentInfo();

            ViewBag.currentregioncode = _objCunr.GetRegionCode();
            return(View());
        }
Ejemplo n.º 6
0
        public string GetHrmsURL()
        {
            CurrentInfo _objCurrInfo        = new CurrentInfo();
            string      LoginParams         = string.Empty;
            string      HRMS_Url            = string.Empty;
            string      HRMS_RedirectingUrl = string.Empty;

            try
            {
                HRMS_RedirectingUrl = _objCurrInfo.GetHRMURL();
                CompanyDetails lstcompdetails = new CompanyDetails();
                lstcompdetails.Company_Code    = _objCurrInfo.GetCompanyCode();
                lstcompdetails.Region_Code     = _objCurrInfo.GetRegionCode();
                lstcompdetails.User_Code       = _objCurrInfo.GetUserCode();
                lstcompdetails.Employee_Code   = _objCurrInfo.GetEmployeeCode();
                lstcompdetails.Employee_Number = _objCurrInfo.GetEmployeeNumber();
                lstcompdetails.UserName        = _objCurrInfo.GetUserName();
                lstcompdetails.User_Type_Code  = _objCurrInfo.GetUserTypeCode();

                LoginParams = JsonConvert.SerializeObject(lstcompdetails);
                byte[] LoginParamsEncode = System.Text.Encoding.UTF8.GetBytes(LoginParams);
                LoginParams = Convert.ToBase64String(LoginParamsEncode);

                if (!string.IsNullOrEmpty(HRMS_RedirectingUrl))
                {
                    HRMS_Url = "" + HRMS_RedirectingUrl + "?SSID=" + LoginParams;
                }
                return(HRMS_Url);
            }
            catch (Exception ex)
            {
                DataControl.Impl.ExceptionHandler.WriteLog(ex, null);
                return(string.Empty);
            }
        }
Ejemplo n.º 7
0
        public string GetOneLibURL()
        {
            CurrentInfo objCurInfo = new CurrentInfo();
            string      oneLibUrl  = string.Empty;

            try
            {
                string companyCode          = objCurInfo.GetCompanyCode();
                string userTypeCode         = objCurInfo.GetUserTypeCode();
                string userCode             = objCurInfo.GetUserCode();
                string oneLibRedirectionUrl = objCurInfo.GetOneLibUrl();
                string sessionId            = objCurInfo.GetSessionId();
                string regionCode           = objCurInfo.GetRegionCode();
                string userName             = objCurInfo.GetUserName();

                if (!string.IsNullOrEmpty(oneLibRedirectionUrl))
                {
                    oneLibUrl = "" + oneLibRedirectionUrl + "?User_Code=" + userCode + "&Comp_Code=" + companyCode + "&Session_Id=" + sessionId + "&Return_URL=" + Request.Url.Authority + "&User_Type_Code=" + userTypeCode + "&Region_Code=" + regionCode + "&User_Name=" + userName + "";
                }
                return(oneLibUrl);
            }
            catch (Exception ex)
            {
                DataControl.Impl.ExceptionHandler.WriteLog(ex, null);
                return(string.Empty);
            }
        }
Ejemplo n.º 8
0
        public string GetWideAngleURL()
        {
            CurrentInfo objCurInfo   = new CurrentInfo();
            string      wideAngleUrl = string.Empty;

            try
            {
                string companyCode  = objCurInfo.GetCompanyCode();
                string userTypeCode = objCurInfo.GetUserTypeCode();
                string userCode     = objCurInfo.GetUserCode();
                string waUrl        = objCurInfo.GetWideAngleUrl();
                string sessionId    = objCurInfo.GetSessionId();
                string regionCode   = objCurInfo.GetRegionCode();
                string userName     = objCurInfo.GetUserName();

                if (!string.IsNullOrEmpty(waUrl))
                {
                    wideAngleUrl = "" + waUrl + "?User_Code=" + userCode + "&Comp_Code=" + companyCode + "&Session_Id=" + sessionId + "&Return_URL=" + Request.Url.Authority + "&User_Type_Code=" + userTypeCode + "&Region_Code=" + regionCode + "&User_Name=" + userName + "";
                }
                return(wideAngleUrl);
            }
            catch (Exception ex)
            {
                ErrorLog.LogError(ex, "GetWideAngleURL()");
                return(ex.Message.ToString());
            }
        }
Ejemplo n.º 9
0
        public JsonResult GetUserRegionholidays()
        {
            CurrentInfo        _objcurrentInfo = new CurrentInfo();
            BLDashBoardLanding objDash         = new BLDashBoardLanding(_objcurrentInfo.GetCompanyCode());

            return(Json(objDash.GetUserRegionholidays(_objcurrentInfo.GetRegionCode()), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 10
0
        public string GetCRMURL()
        {
            CurrentInfo _objCurrInfo = new CurrentInfo();
            string      LoginParams  = string.Empty;
            string      CRMURL       = string.Empty;

            try
            {
                CompanyDetails lstcompdetails = new CompanyDetails();
                lstcompdetails.Company_Code    = _objCurrInfo.GetCompanyCode();
                lstcompdetails.Region_Code     = _objCurrInfo.GetRegionCode();
                lstcompdetails.User_Code       = _objCurrInfo.GetUserCode();
                lstcompdetails.Employee_Code   = _objCurrInfo.GetEmployeeCode();
                lstcompdetails.Employee_Number = _objCurrInfo.GetEmployeeNumber();
                lstcompdetails.UserName        = _objCurrInfo.GetUserName();
                lstcompdetails.User_Type_Code  = _objCurrInfo.GetUserTypeCode();

                LoginParams = JsonConvert.SerializeObject(lstcompdetails);
                byte[] LoginParamsEncode = System.Text.Encoding.UTF8.GetBytes(LoginParams);
                LoginParams = Convert.ToBase64String(LoginParamsEncode);


                CRMURL = LoginParams;
                return(CRMURL);
            }
            catch (Exception ex)
            {
                DataControl.Impl.ExceptionHandler.WriteLog(ex, null);
                return(string.Empty);
            }
        }
Ejemplo n.º 11
0
        public JsonResult GetBirthdayAnniversaryCount()
        {
            CurrentInfo        _objcurrentInfo = new CurrentInfo();
            BLDashBoardLanding objDash         = new BLDashBoardLanding(_objcurrentInfo.GetCompanyCode());

            return(Json(objDash.GetBirthdayAnniversaryCount(_objcurrentInfo.GetRegionCode()), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 12
0
 public PartialViewResult HospitalDetails()
 {
     ViewBag.CompanyCode = _objCurrentInfo.GetCompanyCode();
     ViewBag.RegionCode  = _objCurrentInfo.GetRegionCode();
     ViewBag.UserCode    = _objCurrentInfo.GetUserCode();
     return(PartialView());
 }
Ejemplo n.º 13
0
 public ActionResult TargetSettings()
 {
     _objCurrentInfo           = new CurrentInfo();
     ViewBag.CompanyCode       = _objCurrentInfo.GetCompanyCode();
     ViewBag.RequestRegionCode = _objCurrentInfo.GetRegionCode();
     ViewBag.RequestUserCode   = _objCurrentInfo.GetUserCode();
     return(View());
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Retrieve My Expense Claim Count.
        /// </summary>
        /// <returns>int</returns>
        public int GetMyExpenseClaimUnapprovedCount()
        {
            // Cretaes Instance.
            CurrentInfo        objInfo = new CurrentInfo();
            BLDashBoardLanding objDash = new BLDashBoardLanding(objInfo.GetCompanyCode());

            // Get My Unapproved claims.
            return(objDash.GetMyUnapprovedEntries(objInfo.GetUserCode(), objInfo.GetRegionCode(), DashBoardLanding.Entity.EXPNESECLAIM));
        }
Ejemplo n.º 15
0
        public ActionResult ComplaintForm()
        {
            _objCurrentInfo           = new CurrentInfo();
            ViewBag.CompanyCode       = _objCurrentInfo.GetCompanyCode();
            ViewBag.RequestRegionCode = _objCurrentInfo.GetRegionCode();
            ViewBag.User_Code         = _objCurrentInfo.GetUserCode();

            return(View());
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Retrieve My Unapproved DCR Count.
        /// </summary>
        /// <returns>int</returns>
        public int GetMyDCRUnapprovedCount()
        {
            // Cretaes Instance.
            CurrentInfo        objInfo = new CurrentInfo();
            BLDashBoardLanding objDash = new BLDashBoardLanding(objInfo.GetCompanyCode());

            // Get My Unapprove DCR.
            return(objDash.GetMyUnapprovedEntries(objInfo.GetUserCode(), objInfo.GetRegionCode(), DashBoardLanding.Entity.DCR));
        }
Ejemplo n.º 17
0
        //public void ProcessPrimarySalesUpload(DataSet Ds, DataSet Ds_Validate, DataSet dsMaster, string fileName, string CompanyCode, string CurrUserCode, string ConnectionString, string SubDomain)
        //{
        //    bool Is_error = false;
        //    string strGuid = Guid.NewGuid().ToString();

        //    var hasDupHdr = Ds.Tables[0].AsEnumerable()
        //                   .GroupBy(row => new
        //                   {
        //                       Depot_Name = row.Field<string>("Depot_Name"),
        //                       Region_Name = row.Field<string>("Region_Name"),
        //                       Stockiest_Ref_Key1 = row.Field<string>("Stockiest_Ref_Key1"),
        //                       Document_number =row.Field<dynamic>("Document_number")
        //                   })
        //                   .Where (g => g.Count() > 1)
        //                   .Select(g => g.CopyToDataTable()).ToList();

        //    Ds.Tables[0].Columns.Add(("Region_Ref_Key1"), typeof(string));
        //    Ds.Tables[0].Columns.Add(("Depot_Ref_Key1"), typeof(string));

        //    if (hasDupHdr.Any())
        //    {
        //        ErrorList.Add(new PrimarySalesModel(CompanyCode, "", "", "HD_ERR_0394", ""));
        //        Is_error = true;
        //    }

        //    //check correct dataformat for header sheet - null values and invalid data type
        //    int idxEmptyRowIndex = 1;
        //    foreach (DataRow row_xl in Ds.Tables[0].Rows)
        //    {
        //        DateTime dtFormat;

        //        if (row_xl.AreAllCellsEmpty() || String.IsNullOrWhiteSpace(row_xl["Region_Name"].ToString().Trim()) ||
        //                       String.IsNullOrWhiteSpace(row_xl["Depot_Name"].ToString().Trim()) ||
        //                       String.IsNullOrWhiteSpace(row_xl["Document_number"].ToString().Trim()) ||
        //                       String.IsNullOrWhiteSpace(row_xl["Stockiest_Ref_Key1"].ToString().Trim()) ||
        //                       String.IsNullOrWhiteSpace(row_xl["Document_Type"].ToString().Trim()))
        //        {
        //            //MandatoryFieldsEmpty = true;
        //            ErrorList.Add(new PrimarySalesModel(CompanyCode, "", idxEmptyRowIndex.ToString(), "HD_ERR_0404", ""));
        //            Is_error = true;
        //        }

        //        if (!row_xl.AreAllCellsEmpty())
        //        {
        //            if ((!DateTime.TryParseExact(row_xl["Document_Date"].ToString().Trim(), "dd/MM/yyyy", new CultureInfo("en-GB"), DateTimeStyles.None, out dtFormat)))
        //            {
        //                //DataFormatInvalid = true;
        //                ErrorList.Add(new PrimarySalesModel(CompanyCode, "", idxEmptyRowIndex.ToString(), "HD_ERR_0405", ""));
        //                Is_error = true;
        //            }
        //            else
        //            {
        //                DateTime myDate = DateTime.ParseExact(row_xl["Document_Date"].ToString(), "dd/MM/yyyy",
        //                    System.Globalization.CultureInfo.InvariantCulture);
        //                row_xl["Document_Date"] = myDate.ToString("yyyy/MM/dd");
        //            }

        //            if (!IsIntegerOrDecimal(row_xl["Gross_Amount"].ToString().Trim()) || (!IsIntegerOrDecimal(row_xl["Discount_Amount"].ToString().Trim())
        //                || (!IsIntegerOrDecimal(row_xl["Tax"].ToString().Trim())) || (!IsIntegerOrDecimal(row_xl["Net_Amount"].ToString().Trim()))))
        //            {
        //                ErrorList.Add(new PrimarySalesModel(CompanyCode, "", idxEmptyRowIndex.ToString(), "HD_ERR_0406", ""));
        //                Is_error = true;
        //            }
        //        }
        //        idxEmptyRowIndex++;
        //    }

        //check correct dataformat for detail sheet
        //int idxDtlRows = 1;
        //foreach (DataRow row_xl in Ds.Tables[1].Rows)
        //{
        //    DateTime dtFormat;

        //    if (row_xl.AreAllCellsEmpty() || String.IsNullOrWhiteSpace(row_xl["Region_Name"].ToString().Trim()) ||
        //                   String.IsNullOrWhiteSpace(row_xl["Depot_Name"].ToString().Trim()) ||
        //                   String.IsNullOrWhiteSpace(row_xl["Document_number"].ToString().Trim()) ||
        //                   String.IsNullOrWhiteSpace(row_xl["Stockiest_Ref_Key1"].ToString().Trim()) ||
        //                   String.IsNullOrWhiteSpace(row_xl["Document_Type"].ToString().Trim()))
        //    {
        //        //MandatoryFieldsEmpty = true;
        //        ErrorList.Add(new PrimarySalesModel(CompanyCode, "", idxDtlRows.ToString(), "HD_ERR_0408", ""));
        //        Is_error = true;
        //    }

        //    if (!row_xl.AreAllCellsEmpty())
        //    {
        //        if ((!DateTime.TryParseExact(row_xl["Document_Date"].ToString().Trim(), "dd/MM/yyyy", new CultureInfo("en-GB"), DateTimeStyles.None, out dtFormat)))
        //        {
        //            //DataFormatInvalid = true;
        //            ErrorList.Add(new PrimarySalesModel(CompanyCode, "", idxDtlRows.ToString(), "HD_ERR_0409", ""));
        //            Is_error = true;
        //        }
        //        else
        //        {
        //            DateTime myDate = DateTime.ParseExact(row_xl["Document_Date"].ToString(), "dd/MM/yyyy",
        //                System.Globalization.CultureInfo.InvariantCulture);
        //            row_xl["Document_Date"] = myDate.ToString("yyyy/MM/dd");
        //        }
        //        //if (!IsInteger(row_xl["Sales_Quantity"].ToString().Trim()) || (!IsInteger(row_xl["Free_Quantity"].ToString().Trim())))
        //        //{
        //        //    ErrorList.Add(new PrimarySalesModel(CompanyCode, "", idxDtlRows.ToString(), "HD_ERR_0407", ""));
        //        //    Is_error = true;
        //        //}
        //        if (!IsIntegerOrDecimal(row_xl["Sales_Rate"].ToString().Trim()) || !IsIntegerOrDecimal(row_xl["Sales_Quantity"].ToString().Trim()) || (!IsIntegerOrDecimal(row_xl["Free_Quantity"].ToString().Trim())))
        //        {
        //            ErrorList.Add(new PrimarySalesModel(CompanyCode, "", idxDtlRows.ToString(), "HD_ERR_0440", ""));
        //            Is_error = true;
        //        }
        //    }
        //    idxDtlRows++;
        //}

        //if (Is_error)
        //{
        //    if (ErrorList.Count > 0)
        //    {
        //        Bl.InsertPrimarySalesBatchProcessingHeader(CompanyCode, strGuid, "PSU_UPLOAD", fileName, DateTime.Now.ToString(), "ERROR", CurrUserCode, ConnectionString);
        //        Bl.InsertPrimarySalesBatchProcessing(ErrorList, strGuid, ConnectionString);
        //        //return Json("Not Uploaded");
        //        return;
        //    }
        //}



        //Validating region with master
        //int iRowIndex = 1;
        //foreach (DataRow row_xl in Ds.Tables[0].Rows)
        //{
        //    if (!row_xl.AreAllCellsEmpty())
        //    {
        //        bool prodExists = false;
        //        foreach (DataRow row_val in dsMaster.Tables[0].Rows)
        //        {
        //            if (row_xl["Region_Name"].ToString().Trim() == row_val["Region_Name"].ToString().Trim())
        //            {
        //                row_xl["Region_Ref_Key1"] = row_val["Region_Ref_Key1"].ToString().Trim();
        //                prodExists = true;
        //            }

        //        }

        //        if (!prodExists)
        //        {
        //            ErrorList.Add(new PrimarySalesModel(CompanyCode, "", iRowIndex.ToString(), "HD_ERR_0395",""));
        //            Is_error = true;
        //        }

        //        iRowIndex++;
        //    }
        //}

        //Validating stockiest with master
        //int jRowIndex = 1;
        //foreach (DataRow row_xl in Ds.Tables[0].Rows)
        //{
        //    if (!row_xl.AreAllCellsEmpty())
        //    {
        //        bool prodExists = false;
        //        foreach (DataRow row_val in dsMaster.Tables[1].Rows)
        //        {
        //            if (row_xl["Stockiest_Ref_Key1"].ToString().Trim() == row_val["Stockiest_Ref_Key1"].ToString().Trim() &&
        //                row_xl["Region_Name"].ToString().Trim() == row_val["Region_Name"].ToString().Trim())
        //            {
        //                prodExists = true;
        //            }

        //        }
        //        if (!prodExists)
        //        {
        //            ErrorList.Add(new PrimarySalesModel(CompanyCode, "", jRowIndex.ToString(), "HD_ERR_0397",""));
        //            Is_error = true;
        //        }
        //        jRowIndex++;
        //    }
        //}

        //Validating depot with master
        //int dRowIndex = 1;
        //foreach (DataRow row_xl in Ds.Tables[0].Rows)
        //{
        //    if (!row_xl.AreAllCellsEmpty())
        //    {
        //        bool prodExists = false;
        //        foreach (DataRow row_val in dsMaster.Tables[3].Rows)
        //        {
        //            if (row_xl["Depot_Name"].ToString().Trim() == row_val["Depot_Name"].ToString().Trim()
        //                && (row_xl["Region_Name"].ToString().Trim() == row_val["Region_Name"].ToString().Trim()))
        //            {
        //                row_xl["Depot_Ref_Key1"] = row_val["Depot_Ref_Key1"].ToString().Trim();
        //                prodExists = true;
        //            }

        //        }
        //        if (!prodExists)
        //        {
        //            ErrorList.Add(new PrimarySalesModel(CompanyCode, "", dRowIndex.ToString(), "HD_ERR_0396",""));
        //            Is_error = true;
        //        }
        //        dRowIndex++;
        //    }
        //}

        //Validating document type with master
        //        int dtRowIndex = 1;
        //        foreach (DataRow row_xl in Ds.Tables[0].Rows)
        //        {
        //            if (!row_xl.AreAllCellsEmpty())
        //            {
        //                bool prodExists = false;
        //                foreach (DataRow row_val in dsMaster.Tables[4].Rows)
        //                {
        //                    if (row_xl["Document_Type"].ToString().Trim() == row_val["Document_Type"].ToString().Trim())
        //                    {
        //                        prodExists = true;
        //                    }

        //                }
        //                if (!prodExists)
        //                {
        //                    ErrorList.Add(new PrimarySalesModel(CompanyCode, "", dtRowIndex.ToString(), "HD_ERR_0398",""));
        //                    Is_error = true;
        //                }
        //                dtRowIndex++;
        //            }
        //        }


        //        if (Is_error)
        //        {
        //            Bl.InsertPrimarySalesBatchProcessingHeader(CompanyCode, strGuid, "PSU_UPLOAD", fileName, DateTime.Now.ToString(), "ERROR", CurrUserCode, ConnectionString);
        //            Bl.InsertPrimarySalesBatchProcessing(ErrorList, strGuid, ConnectionString);
        //        }
        //        else
        //        {
        //            //verify header value and detail values
        //            var qry1 = Ds.Tables[1].AsEnumerable().Select(a => new
        //            {
        //                Document_Number = a["Document_Number"].ToString().Trim(),
        //                Region_Name = a["Region_Name"].ToString().Trim(),
        //                Depot_Name = a["Depot_Name"].ToString().Trim(),
        //                Stockiest_Ref_Key1 = a["Stockiest_Ref_Key1"].ToString().Trim(),
        //                Document_Type = a["Document_Type"].ToString().Trim()
        //            });
        //            var qry2 = Ds.Tables[0].AsEnumerable().Select(b => new
        //            {
        //                Document_Number = b["Document_Number"].ToString().Trim(),
        //                Region_Name = b["Region_Name"].ToString().Trim(),
        //                Depot_Name = b["Depot_Name"].ToString().Trim(),
        //                Stockiest_Ref_Key1 = b["Stockiest_Ref_Key1"].ToString().Trim(),
        //                Document_Type = b["Document_Type"].ToString().Trim()
        //            });

        //            var exceptAB = qry1.Except(qry2);

        //            if (exceptAB.Any())
        //            {
        //                foreach (var item in exceptAB.ToList())
        //                {
        //                    ErrorList.Add(new PrimarySalesModel(CompanyCode, "", "", "HD_ERR_0399",""));
        //                    Is_error = true;
        //                }
        //            }
        //            if (Is_error)
        //            {
        //                Bl.InsertPrimarySalesBatchProcessingHeader(CompanyCode, strGuid, "PSU_UPLOAD", fileName, DateTime.Now.ToString(), "ERROR", CurrUserCode, ConnectionString);
        //                Bl.InsertPrimarySalesBatchProcessing(ErrorList, strGuid, ConnectionString);
        //                return;
        //            }

        //            //Validate for same document number, region, depot and stockiest
        //            int intSameRowExists = 1;
        //            foreach (DataRow row_xl in Ds.Tables[0].Rows)
        //            {
        //                if (!row_xl.AreAllCellsEmpty())
        //                {
        //                    bool sameRowExists = false;
        //                    foreach (DataRow row_val in Ds_Validate.Tables[0].Rows)
        //                    {
        //                        if (row_xl["Region_Name"].ToString().Trim() == row_val["Region_Name"].ToString().Trim() &&
        //                            row_xl["Depot_Name"].ToString().Trim() == row_val["Depot_Name"].ToString().Trim() &&
        //                            row_xl["Document_number"].ToString().Trim() == row_val["Document_number"].ToString().Trim() &&
        //                            row_xl["Stockiest_Ref_Key1"].ToString().Trim() == row_val["Stockiest_Ref_Key1"].ToString().Trim())
        //                        {
        //                            sameRowExists = true;
        //                        }

        //                    }
        //                    if (sameRowExists)
        //                    {
        //                        ErrorList.Add(new PrimarySalesModel(CompanyCode, "", intSameRowExists.ToString(), "HD_ERR_0403",""));
        //                        Is_error = true;
        //                    }
        //                    intSameRowExists++;
        //                }
        //            }

        //            //Validating product with master
        //            int intProdRowIndex = 1;
        //            foreach (DataRow row_xl in Ds.Tables[1].Rows)
        //            {
        //                if (!row_xl.AreAllCellsEmpty())
        //                {
        //                    bool prodExists = false;
        //                    foreach (DataRow row_val in Ds_Validate.Tables[1].Rows)
        //                    {
        //                        if (row_xl["Product_Ref_Key1"].ToString().Trim() == row_val["Product_Ref_Key1"].ToString().Trim())
        //                        {
        //                            prodExists = true;
        //                        }

        //                    }
        //                    if (!prodExists)
        //                    {
        //                        ErrorList.Add(new PrimarySalesModel(CompanyCode, "", intProdRowIndex.ToString(), "HD_ERR_0400",""));
        //                        Is_error = true;
        //                    }
        //                    intProdRowIndex++;
        //                }

        //            }

        //            //validating Return available quantity
        //            if (Ds_Validate.Tables[2].Rows.Count > 0)
        //            {
        //                int intProdQntRowIndex = 1;
        //                foreach (DataRow row_xl in Ds.Tables[1].Rows)
        //                {
        //                    if (!row_xl.AreAllCellsEmpty())
        //                    {
        //                        if (row_xl["Document_Type"].ToString() != "INVOICE")
        //                        {
        //                            foreach (DataRow row_val in Ds_Validate.Tables[2].Rows)
        //                            {
        //                                if (row_xl["Region_Name"].ToString().Trim() == row_val["Region_Name"].ToString().Trim() &&
        //                                    row_xl["Depot_Name"].ToString().Trim() == row_val["Depot_Name"].ToString().Trim() &&
        //                                    row_xl["Stockiest_Ref_Key1"].ToString().Trim() == row_val["Stockiest_Ref_Key1"].ToString().Trim() &&
        //                                    row_xl["Document_Number"].ToString().Trim() == row_val["Document_Number"].ToString().Trim() &&
        //                                    row_xl["Product_Ref_Key1"].ToString().Trim() == row_val["Product_Ref_key1"].ToString().Trim() &&
        //                                    row_xl["Batch_Number"].ToString().Trim() == row_val["Batch_Number"].ToString().Trim() &&
        //                                    Convert.ToDecimal(row_xl["Sales_Quantity"].ToString().Trim()) > Convert.ToDecimal(row_val["Available_Quantity"].ToString().Trim()))
        //                                {
        //                                    ErrorList.Add(new PrimarySalesModel(CompanyCode, "", intProdQntRowIndex.ToString(), "HD_ERR_0401",""));
        //                                    Is_error = true;
        //                                }
        //                            }
        //                        }
        //                        intProdQntRowIndex++;
        //                    }
        //                }
        //            }


        //            if (Is_error)
        //            {
        //                if (ErrorList.Count > 0)
        //                {
        //                    Bl.InsertPrimarySalesBatchProcessingHeader(CompanyCode, strGuid, "PSU_UPLOAD", fileName, DateTime.Now.ToString(), "ERROR",CurrUserCode, ConnectionString);
        //                    Bl.InsertPrimarySalesBatchProcessing(ErrorList, strGuid, ConnectionString);
        //                    //return Json("Not Uploaded");
        //                }
        //            }
        //            else
        //            {
        //                string error = Bl.PrimarySaleBulkInsert(SubDomain, CompanyCode, CurrUserCode, fileName, Ds, "tbl_sfa_PrimarySales_Header", "tbl_sfa_PrimarySales_details");
        //                if (error == "Success")
        //                {
        //                    Bl.InsertPrimarySalesBatchProcessingHeader(CompanyCode, strGuid, "PSU_UPLOAD", fileName, DateTime.Now.ToString(), "SUCCESS", CurrUserCode, ConnectionString);
        //                }
        //                else
        //                {
        //                    Bl.InsertPrimarySalesBatchProcessingHeader(CompanyCode, strGuid, "PSU_UPLOAD", fileName, DateTime.Now.ToString(), "ERROR", CurrUserCode, ConnectionString);
        //                    ErrorList.Add(new PrimarySalesModel(CompanyCode, "", "", "HD_ERR_0402", error));
        //                    Bl.InsertPrimarySalesBatchProcessing(ErrorList, strGuid, ConnectionString);
        //                }

        //            }
        //        }
        //    }

        //    public bool IsIntegerOrDecimal(string sVal)
        //    {
        //        try
        //        {
        //            // must be numeric value
        //            double d = double.Parse(sVal);
        //            // max of two decimal places
        //            if (sVal.IndexOf(".") >= 0)
        //            {
        //                if (sVal.Length > sVal.IndexOf(".") + 3)
        //                {
        //                    return false;
        //                }
        //                if (d < 0)
        //                {
        //                    return false;
        //                }
        //            }
        //            else
        //            {
        //                if (d < 0)
        //                {
        //                    return false;
        //                }
        //            }
        //            return true;
        //        }
        //        catch
        //        {
        //            return false;
        //        }
        //    }


        //    public bool IsInteger(string sVal)
        //    {
        //        try
        //        {
        //            int num = int.Parse(sVal);

        //            if (num < 0)
        //            {
        //                return false;
        //            }


        //            return true;
        //        }
        //        catch
        //        {
        //            return false;
        //        }
        //    }

        //    public ActionResult BatchProcessing()
        //    {
        //        return View();
        //    }
        //}

        //extension method for datarow
        //    public static class DataExtensions
        //    {
        //        public static bool AreAllCellsEmpty(this DataRow row)
        //        {
        //            var itemArray = row.ItemArray;
        //            if (itemArray == null)
        //                return true;
        //            return itemArray.All(x => string.IsNullOrWhiteSpace(x.ToString()));
        //        }


        //        //}
        //    }
        //To Get Product List
        public JsonResult GetProducts()
        {
            string Region_Code = _objCurrentInfo.GetRegionCode();

            Dt = new DataTable();
            Dt = Bl.GetProducts(Region_Code);
            JSONConverter json = new JSONConverter();

            return(Json(json.Serialize(Dt), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 18
0
 public ActionResult InwardAllocation()
 {
     _objCurrentInfo      = new CurrentInfo();
     ViewBag.CompanyCode  = _objCurrentInfo.GetCompanyCode();
     ViewBag.RegionCode   = _objCurrentInfo.GetRegionCode();
     ViewBag.RegionName   = _objCurrentInfo.GetRegionName();
     ViewBag.UserCode     = _objCurrentInfo.GetUserCode();
     ViewBag.UserName     = _objCurrentInfo.GetUserName();
     ViewBag.UserTypeName = _objCurrentInfo.GetUserTypeName();
     return(View());
 }
Ejemplo n.º 19
0
 public ActionResult STOS_Approval()
 {
     _objCurrentInfo      = new CurrentInfo();
     ViewBag.CompanyCode  = _objCurrentInfo.GetCompanyCode();
     ViewBag.RegionCode   = _objCurrentInfo.GetRegionCode();
     ViewBag.RegionName   = _objCurrentInfo.GetRegionName();
     ViewBag.UserCode     = _objCurrentInfo.GetUserCode();
     ViewBag.UserName     = _objCurrentInfo.GetUserName();
     ViewBag.UserTypeName = _objCurrentInfo.GetUserTypeName();
     return(View());
 }
Ejemplo n.º 20
0
        public ActionResult Index(string dcrActualDate, string flag, string Company_Code, string UserCode, string RegionCode, int CompanyId)
        {
            string today = DateTime.Now.ToShortDateString();

            ViewBag.possibleDays = _objBLDCR.GetNextTwoPossibleDays(objCurr.GetCompanyCode(), objCurr.GetUserCode(), objCurr.GetRegionCode(), today);
            ViewBag.flag         = flag;
            ViewBag.dcrDate      = dcrActualDate;
            ViewBag.Company_Code = objCurr.GetCompanyCode();
            ViewBag.UserCode     = objCurr.GetUserCode();
            ViewBag.RegionCode   = objCurr.GetRegionCode();
            ViewBag.CompanyId    = objCurr.GetCompanyId();
            return(View());
        }
Ejemplo n.º 21
0
        public JsonResult GetExcelApiInputData(string sessionKey, string searchKey)
        {
            CurrentInfo _objcurrentInfo = new CurrentInfo();

            Repository.APIRepository objAPIRepo = new Repository.APIRepository();
            string companyCode = _objcurrentInfo.GetCompanyCode();
            string userCode    = _objcurrentInfo.GetUserCode();
            string regionCode  = _objcurrentInfo.GetRegionCode();
            List <MVCModels.HiDoctor_Reports.ExcelApiInput> lstExcelApiList = new List <MVCModels.HiDoctor_Reports.ExcelApiInput>();

            lstExcelApiList = objAPIRepo.GetExcelApiInputData(companyCode, userCode, regionCode, sessionKey, searchKey);
            return(Json(_objJSON.Serialize(lstExcelApiList), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 22
0
 public ActionResult Request(string regionCode, int?stosId)
 {
     _objCurrentInfo             = new CurrentInfo();
     ViewBag.CompanyCode         = _objCurrentInfo.GetCompanyCode();
     ViewBag.RequestRegionCode   = _objCurrentInfo.GetRegionCode();
     ViewBag.RequestRegionName   = _objCurrentInfo.GetRegionName();
     ViewBag.RequestUserCode     = _objCurrentInfo.GetUserCode();
     ViewBag.RequestUserName     = _objCurrentInfo.GetUserName();
     ViewBag.RequestUserTypeName = _objCurrentInfo.GetUserTypeName();
     ViewBag.RequestUserTypeCode = _objCurrentInfo.GetUserTypeCode();
     ViewBag.StosId       = stosId;
     ViewBag.SelectedUser = regionCode;
     return(View());
 }
Ejemplo n.º 23
0
        /// <summary>
        /// Dashboard landing page.
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            // create intances.
            CurrentInfo        objInfo = new CurrentInfo();
            BLDashBoardLanding objDash = new BLDashBoardLanding(objInfo.GetCompanyCode());

            ViewBag.User_Code = objInfo.GetUserCode();
            int teamCount = objDash.GetImmediateChildUserCount(objInfo.GetUserCode());

            ViewBag.teamCount   = teamCount;
            ViewBag.CompanyCode = objInfo.GetCompanyCode();
            ViewBag.Region_Code = objInfo.GetRegionCode();
            return(View());
        }
Ejemplo n.º 24
0
        public ActionResult STOSEmailTrigger()
        {
            _objCurrentInfo             = new CurrentInfo();
            ViewBag.CompanyCode         = _objCurrentInfo.GetCompanyCode();
            ViewBag.RequestRegionCode   = _objCurrentInfo.GetRegionCode();
            ViewBag.RequestRegionName   = _objCurrentInfo.GetRegionName();
            ViewBag.RequestUserCode     = _objCurrentInfo.GetUserCode();
            ViewBag.RequestUserName     = _objCurrentInfo.GetUserName();
            ViewBag.RequestUserTypeName = _objCurrentInfo.GetUserTypeName();
            ViewBag.RequestUserTypeCode = _objCurrentInfo.GetUserTypeCode();


            return(View());
        }
Ejemplo n.º 25
0
        public string urlEncodeing()
        {
            MVCModels.UserInfoModel objuser    = new MVCModels.UserInfoModel();
            CurrentInfo             objCurInfo = new CurrentInfo();
            string userParam = string.Empty;

            objuser.Company_Code   = objCurInfo.GetCompanyCode();
            objuser.User_Code      = objCurInfo.GetUserCode();
            objuser.User_Type_Code = objCurInfo.GetUserTypeCode();
            objuser.Region_Code    = objCurInfo.GetRegionCode();
            objuser.Company_Id     = objCurInfo.GetCompanyId();
            objuser.User_Details   = objCurInfo.GetUserName() + " (" + objCurInfo.GetUserTypeName() + ")";
            objuser.Is_Mobile      = "NO";
            userParam = Newtonsoft.Json.JsonConvert.SerializeObject(objuser);
            byte[] LoginParamsEncode = System.Text.Encoding.UTF8.GetBytes(userParam);
            userParam = Convert.ToBase64String(LoginParamsEncode);
            return(userParam);
        }
Ejemplo n.º 26
0
        //public bool SaveMapping(string Weekend_Code, string Price_group_code, string Region_Lock, string Chemist_Lock, string Region_Type_Code, string Effective_From, string Effective_To, string divisionCode, string holiday_Code, string holiday_name)
        //{
        //    bool result = false;
        //    string companyCode = null;
        //    string UserCode = null;
        //    string Companyid = null;
        //    try
        //    {
        //        _objCurrInfo = new CurrentInfo();
        //        companyCode = _objCurrInfo.GetCompanyCode();
        //        UserCode = _objCurrInfo.GetUserCode();
        //        Companyid = _objCurrInfo.GetCompanyId();
        //        result = _objbl.SaveMapping(companyCode, UserCode, region_Code, Companyid, Weekend_Code, Price_group_code, Region_Lock, Chemist_Lock, Region_Type_Code, Effective_From, Effective_To, divisionCode, holiday_Code, holiday_name);
        //    }
        //    catch (Exception ex)
        //    {
        //        throw;
        //    }
        //    return result;
        //}
        #endregion Creation

        #region Disable
        //Disable - Region Creation Wizard
        public JsonResult GetActiveRegions()
        {
            string             companyCode = null;
            string             region_Code = null;
            List <UnderRegion> lstactreg   = null;

            try
            {
                _objCurrInfo = new CurrentInfo();
                companyCode  = _objCurrInfo.GetCompanyCode();
                region_Code  = _objCurrInfo.GetRegionCode();
                lstactreg    = _objbl.GetActiveRegions(companyCode, region_Code).ToList();
                return(Json(lstactreg, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 27
0
        public JsonResult CheckTPAvailableForSelectedLeaveDates(string leaveFromDate, string leaveToDate)
        {
            try
            {
                SPData        objSPData      = new SPData();
                CurrentInfo   objcurrentInfo = new CurrentInfo();
                StringBuilder LeaveDates     = new StringBuilder();



                DateTime fromDate = Convert.ToDateTime(leaveFromDate);
                DateTime toDate   = Convert.ToDateTime(leaveToDate);

                for (DateTime i = fromDate; i <= toDate; i = i.AddDays(1))
                {
                    LeaveDates.Append(i.ToShortDateString());
                    LeaveDates.Append("^");
                }



                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, LeaveDates.ToString());

                // 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;
            }
        }
Ejemplo n.º 28
0
        public JsonResult GetDivisionsBasedonLoggedUser()
        {
            List <MVCModels.DivisionModel> lstDivision = null;
            string companyCode = null;
            string regionCode  = null;

            try
            {
                BLDivision  _ObjDivisns     = new BLDivision();
                CurrentInfo _ObjCurrentInfo = new CurrentInfo();
                companyCode = ViewBag.Company_Code = _ObjCurrentInfo.GetCompanyCode();
                regionCode  = ViewBag.Region_Code = _ObjCurrentInfo.GetRegionCode();
                lstDivision = _ObjDivisns.GetDivisionsBasedonLoggedUser(companyCode, regionCode);
                return(Json(lstDivision, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 29
0
        public ActionResult MasterDataHandler(string SSID)
        {
            UserInfoModel _objcomp = new UserInfoModel();

            if (!string.IsNullOrEmpty(SSID))
            {
                byte[] EncodedParams = Convert.FromBase64String(SSID);
                string Params        = System.Text.Encoding.UTF8.GetString(EncodedParams);
                _objcomp = Newtonsoft.Json.JsonConvert.DeserializeObject <UserInfoModel>(Params);

                ViewBag.CompanyCode       = _objcomp.Company_Code;
                ViewBag.UserCode          = _objcomp.User_Code;
                ViewBag.UTypeCode         = _objcomp.User_Type_Code;
                ViewBag.RegionCode        = _objcomp.Region_Code;
                ViewBag.UserDetails       = _objcomp.User_Details;
                ViewBag.Company_Id        = _objcomp.Company_Id;
                ViewBag.BatchProcessingId = _objcomp.BatchProcessingId;
                ViewBag.BP_Guid           = _objcomp.BP_Guid;
                ViewBag.LoadType          = "Mail";
                ViewBag.FileProcessId     = _objcomp.FileProcessId;
                ViewBag.ViewType          = _objcomp.ViewType;
            }
            else
            {
                CurrentInfo _objCurrentInfo = new CurrentInfo();
                ViewBag.CompanyCode       = _objCurrentInfo.GetCompanyCode();
                ViewBag.UserCode          = _objCurrentInfo.GetUserCode();
                ViewBag.UTypeCode         = _objCurrentInfo.GetUserTypeCode();
                ViewBag.RegionCode        = _objCurrentInfo.GetRegionCode();
                ViewBag.UserDetails       = _objCurrentInfo.GetCompanyCode();
                ViewBag.Company_Id        = _objCurrentInfo.GetCompanyId();
                ViewBag.LoadType          = "Screen";
                ViewBag.BatchProcessingId = 155;
                ViewBag.BP_Guid           = "32EAA70B-89C3-42CC-9F19-F8BA55224531";
                ViewBag.FileProcessId     = 66;
                ViewBag.ViewType          = "MasterData";
            }
            return(View());
        }
Ejemplo n.º 30
0
        public JsonResult GetAllCampaignsBasedonRegion()
        {
            string companyCode           = null;
            string currentregionCode     = null;
            List <CampaignModel> lstCamp = null;

            try
            {
                companyCode       = ObjCurrInfo.GetCompanyCode();
                currentregionCode = ObjCurrInfo.GetRegionCode();
                lstCamp           = ObjPR.GetAllCampaignsBasedonRegion(companyCode, currentregionCode).ToList();
                return(Json(lstCamp, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw;
            }
        }