Пример #1
0
 public HttpResponseMessage GetGSCMDetails(GetReqParam temp)
 {
     try
     {
         gscmVM = gscmService.GetGSCMSupplyChainDetails(Convert.ToInt32(temp.approvalStep), Convert.ToInt32(temp.RequestID));
         gscmVM.GSCMReqDetails.UserId = HttpContext.Current.Session["FullUserName"].ToString();
         string strOtherData = string.IsNullOrEmpty(gscmVM.GSCMReqDetails.status) ? string.Empty : gscmVM.GSCMReqDetails.status;
         if (Convert.ToInt32(temp.approvalStep) == 1)
         {
             if (strOtherData != "" || strOtherData != string.Empty)
             {
                 string pageCode = string.Empty;
                 pageCode = "GSCM1_SC";
                 if (base.PageDisable(pageCode, Convert.ToInt32(strOtherData)) == 1)
                 {
                     DisableControls();
                 }
                 else if (base.PageDisable(pageCode, Convert.ToInt32(strOtherData)) == 2)
                 {
                     gscmVM.SaveDisabledGSCM   = true;
                     gscmVM.SubmitDisabledGSCM = true;
                 }
             }
         }
         else
         {
             if (strOtherData != "")
             {
                 string pageCode = string.Empty;
                 pageCode = "GSCM2_SC";
                 if (base.PageDisable(pageCode, Convert.ToInt32(strOtherData)) == 1)
                 {
                     DisableControls();
                 }
                 else if (base.PageDisable(pageCode, Convert.ToInt32(strOtherData)) == 2)
                 {
                     gscmVM.SaveDisabledGSCM   = true;
                     gscmVM.SubmitDisabledGSCM = true;
                 }
             }
         }
         if ((baseService.GetOrigitorName(Convert.ToInt32(temp.RequestID)).Rows[0]["Origitor"].ToString().ToUpper() == UserName.ToUpper()) || ((HttpContext.Current.Session[Constants.SESSION_USER_ROLE].ToString().ToUpper()) == "ADMIN"))
         {
             //If true then dont do anything
         }
         else
         {
             DisableControls();
         }
         return(Request.CreateResponse(HttpStatusCode.OK, gscmVM));
     }
     catch (Exception ex)
     {
         NameValueCollection additionalInfo = new NameValueCollection();
         additionalInfo.Add("PageName", "GSCM");
         ExceptionManager.Publish(ex, additionalInfo);
         Message = errMessages.GetString(Constants.Err_PageLoad);
         errEntity.ErrorNumber = 420;
         errEntity.ErrorMess   = Message;
         gscmVM.ErrorBE        = errEntity;
         return(Request.CreateResponse(HttpStatusCode.OK, gscmVM));
     }
 }
Пример #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));
            }
        }
Пример #3
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));
        }