Example #1
0
        public HttpResponseMessage EPTRangeDetails(GetReqParam temp)
        {
            try
            {
                eptVM = eptService.GetEPTRequestDetails(Convert.ToInt32(temp.RequestID), Convert.ToInt32(temp.Copy));

                if (temp.Copy != null && temp.Copy != "0")
                {
                    i = 1;
                    int ret = cmbService.GetNumberofDays("EPT-Copy");
                    dtdateTime    = DateTime.Now.AddDays(ret);
                    eptVM.MTOShow = false;
                    DisableCopy(temp.Copy);
                }
                else
                {
                    int ret = cmbService.GetNumberofDays("EPT");
                    dtdateTime    = DateTime.Now.AddDays(ret);
                    eptVM.MTOShow = true;
                    DisableCopy(temp.Copy);
                    eptVM.disableCopy = true;
                }

                int iIsParent = Convert.IsDBNull(eptVM.EPTRangeReq.parent) ? 0 : eptVM.EPTRangeReq.parent;
                if (iIsParent == 1)
                {
                    i = 1;
                    eptVM.disableCopy         = true;
                    eptVM.CommentsSectionShow = false;
                    eptVM.TypeHereAI          = false;
                    DisableCopy(temp.Copy);
                }
                //Call presenter function and sets the value of the table on the screen
                eptVM.GetCopyRequestNos = eptService.GetCopyRequestDetails(Convert.ToInt32(temp.RequestID));

                string strOther = string.IsNullOrEmpty(eptVM.EPTRangeReq.OtherData) ? string.Empty : eptVM.EPTRangeReq.OtherData;
                if (strOther != string.Empty)
                {
                    if (strOther.Split(',')[0].ToString() != string.Empty)
                    {
                        if (Convert.ToInt32(strOther.Split(',')[0]) == 1)
                        {
                            eptVM.disableCopy = false;
                        }
                        //For disabling the page if request is already submitted
                        if (base.PageDisable("EPT", Convert.ToInt32(strOther.Split(',')[0])) == 1)
                        {
                            DisableControls();
                        }
                        //commented by Jayashree
                        else if (base.PageDisable("EPT", Convert.ToInt32(strOther.Split(',')[0])) == 2) //&& Request.QueryString["Copy"] == null)
                        {
                            eptVM.SubmitEnableEPT = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                NameValueCollection additionalInfo = new NameValueCollection();
                additionalInfo.Add("PageName", "Get EPT Range details");
                ExceptionManager.Publish(ex, additionalInfo);
                errEntity.ErrorNumber = 420;
                errEntity.ErrorMess   = "Error in Get EPT Range details";
                eptVM.ErrorBE         = errEntity;
            }
            return(Request.CreateResponse(HttpStatusCode.OK, eptVM));
        }
Example #2
0
        public HttpResponseMessage GetNewPackDetails(GetReqParam temp)
        {
            NewPackReqService = new NewPackRequestService();
            npReqVM           = new NewPackRequestViewModel();
            cmbService        = new CombiPackRequestService();
            DateTime dtFirstSaleCheck = new DateTime();

            //npReqVM = NewPackReqService.GetNewRequestDetails(Convert.ToInt32(reqID), Convert.ToInt32(reqType));
            try
            {
                if (temp.RequestID != string.Empty)
                {
                    npReqVM = NewPackReqService.GetNewRequestDetails(Convert.ToInt32(temp.RequestID), Convert.ToInt32(temp.ReqType));
                }
                else
                {
                    npReqVM = NewPackReqService.GetNewRequestDetails(0, Convert.ToInt32(temp.ReqType));
                }


                if (npReqVM.NewPackRequest != null && npReqVM.NewPackRequest.GetReactivation_Request == "1")
                {
                    HttpContext.Current.Session["ifshow"] = "Yes";
                }
                else
                {
                    HttpContext.Current.Session["ifshow"] = "No";
                }

                if (Convert.ToInt32(temp.ReqType) == 2)
                {
                    int ret = cmbService.GetNumberofDays("New Pack");
                    dtFirstSaleCheck = DateTime.Now.AddDays(ret);
                    npReqVM.NPCAPresonSynBrandPack = true;
                }
                else if (Convert.ToInt32(temp.ReqType) == 3)
                {
                    int ret = cmbService.GetNumberofDays("Country Add");
                    dtFirstSaleCheck = DateTime.Now.AddDays(ret);
                    npReqVM.NPCAPresonSynBrandPack = false;
                }

                //SOCB - LRMS change - Added Procurement Manager
                npReqVM.ProcurementManager = HttpContext.Current.Session[Constants.USER_REGION].ToString().Equals(Constants.REGION_LATAM) ? true : false;
                //EOCB - LRMS change - Added Procurement Manager

                DisplayTypeSpecificFields(Convert.ToInt32(temp.ReqType), 0);
                if (npReqVM.NewPackRequest != null)
                {
                    isChild = Convert.IsDBNull(npReqVM.NewPackRequest.GetIsChild) ? 0 : npReqVM.NewPackRequest.GetIsChild;
                    if (Convert.ToInt32(temp.ReqType) == 2 && isChild != 1)
                    {
                        //check with team
                    }

                    DisplayTypeSpecificFields(Convert.ToInt32(temp.ReqType), isChild);
                    string strOther = string.IsNullOrEmpty(npReqVM.NewPackRequest.GetOtherData) ? string.Empty : npReqVM.NewPackRequest.GetOtherData;
                    if (strOther != string.Empty)
                    {
                        if (strOther.Split(',')[0] != string.Empty)
                        {
                            if (Convert.ToInt32(temp.ReqType) == 3)
                            {
                                if (base.PageDisable("CA", Convert.ToInt32(strOther.Split(',')[0])) == 1)
                                {
                                    DisableControls();
                                }
                                else if (base.PageDisable("CA", Convert.ToInt32(strOther.Split(',')[0])) == 2)
                                {
                                    npReqVM.SubmitEnabledNPR = true;
                                }
                            }
                            else if (Convert.ToInt32(temp.ReqType) == 2)
                            {
                                if (base.PageDisable("NP", Convert.ToInt32(strOther.Split(',')[0])) == 1)
                                {
                                    DisableControls();
                                }
                                else if (base.PageDisable("NP", Convert.ToInt32(strOther.Split(',')[0])) == 2)
                                {
                                    npReqVM.SubmitEnabledNPR = true;
                                }
                            }
                        }
                    }
                }
                npReqVM.Region = HttpContext.Current.Session["Region"] != null ? HttpContext.Current.Session["Region"].ToString() : string.Empty;
                return(Request.CreateResponse(HttpStatusCode.OK, npReqVM));
            }
            catch (Exception ex)
            {
                NameValueCollection additionalInfo = new NameValueCollection();
                additionalInfo.Add("PageName", "NewPackRequest");
                ExceptionManager.Publish(ex, additionalInfo);
                //Message = errMessages.GetString("Error in loading Other Range request data from Controller");
                errEntity.ErrorNumber = 420;
                errEntity.ErrorMess   = "Error in GetNewPackDetails method of NewPackRequest controller." + ex.InnerException;
                npReqVM.ErrorBE       = errEntity;
                return(Request.CreateResponse(HttpStatusCode.OK, npReqVM));
            }
        }
Example #3
0
        public HttpResponseMessage GetNewPackDetails(int requestID)
        {
            cprVM = new CombiPackRequestViewModel();
            try
            {
                CombiReqService = new CombiPackRequestService();
                cprVM           = CombiReqService.GetCombiDetails(requestID);
                if (cprVM.CombiPackRequest.IsSynBrdPack1 != null && cprVM.CombiPackRequest.IsSynBrdPack2 != null)
                {
                    if (cprVM.CombiPackRequest.IsSynBrdPack1.Trim().ToLower() == "yes" || cprVM.CombiPackRequest.IsSynBrdPack2.Trim().ToLower() == "yes")
                    {
                        cprVM.CombiPackRequest.IsSynBrdPack = "Yes";
                    }
                    else if (cprVM.CombiPackRequest.IsSynBrdPack3 != null)
                    {
                        if (cprVM.CombiPackRequest.IsSynBrdPack3.Trim().ToLower() == "yes")
                        {
                            cprVM.CombiPackRequest.IsSynBrdPack = "Yes";
                        }
                        else if (cprVM.CombiPackRequest.IsSynBrdPack4 != null)
                        {
                            if (cprVM.CombiPackRequest.IsSynBrdPack4.Trim().ToLower() == "yes")
                            {
                                cprVM.CombiPackRequest.IsSynBrdPack = "Yes";
                            }
                            else
                            {
                                cprVM.CombiPackRequest.IsSynBrdPack = "No";
                            }
                        }
                        else
                        {
                            cprVM.CombiPackRequest.IsSynBrdPack = "No";
                        }
                    }
                    else
                    {
                        cprVM.CombiPackRequest.IsSynBrdPack = "No";
                    }
                }

                DateTime dtFirstSaleCheck = new DateTime();
                int      ret = CombiReqService.GetNumberofDays("Combi Pack");
                dtFirstSaleCheck = DateTime.Now.AddDays(ret);

                int iIsPresent = 0;
                if (cprVM.CombiPackRequest != null)
                {
                    iIsPresent = Convert.IsDBNull(cprVM.CombiPackRequest.isSucess) ? 0 : cprVM.CombiPackRequest.isSucess;
                }
                if (iIsPresent == 3 || iIsPresent == 1)
                {
                    if (cprVM.CombiPackRequest.SourceLocally)
                    {
                        cprVM.CPSourceLocallyDetailsEnable = false;
                    }
                    else
                    {
                        cprVM.CPSourceLocallyDetailsEnable = true;
                    }
                }

                string strOther = string.Empty;
                if (cprVM.CombiPackRequest != null)
                {
                    strOther = string.IsNullOrEmpty(cprVM.CombiPackRequest.OtherData) ? string.Empty : cprVM.CombiPackRequest.OtherData;
                }
                if (strOther != string.Empty)
                {
                    if (base.PageDisable("CMBI", Convert.ToInt32(strOther.Split(',')[0])) == 1)
                    {
                        DisableControls();
                    }
                    else if (base.PageDisable("CMBI", Convert.ToInt32(strOther.Split(',')[0])) == 2)
                    {
                        cprVM.SubmitEnableCP = false;
                    }
                }
                cprVM.Region = HttpContext.Current.Session[Constants.USER_REGION] != null ? HttpContext.Current.Session[Constants.USER_REGION].ToString() : string.Empty;
                return(Request.CreateResponse(HttpStatusCode.OK, cprVM));
            }
            catch (Exception ex)
            {
                NameValueCollection additionalInfo = new NameValueCollection();
                additionalInfo.Add("PageName", "CombiPackFormD");
                ExceptionManager.Publish(ex, additionalInfo);
                //Message = errMessages.GetString("Admin - To get new pack details");
                errEntity.ErrorNumber = 420;
                errEntity.ErrorMess   = "Error in GetNewPackDetails method of combipackformD controller";
                cprVM.ErrorBE         = errEntity;
                return(Request.CreateResponse(HttpStatusCode.OK, cprVM));
            }
        }