Esempio n. 1
0
        public ActionResult DCRAdminIndex(int id = 0)
        {
            DCRAdminContract contract = null;

            if (id > 0 && DCRBusinessLayer.Instance.IsAdminUser(this.CurrentUser.UserId))
            {
                Dictionary <string, string> objDict = new Dictionary <string, string>();
                objDict.Add("FormName", FormNames.DCRADMINFORM);
                objDict.Add("ItemId", id.ToString());
                objDict.Add(Parameter.USEREID, this.CurrentUser.UserId);
                ViewBag.UserID   = this.CurrentUser.UserId;
                ViewBag.UserName = this.CurrentUser.FullName;

                contract = this.GetAdminDCRDetails(objDict);

                if (contract.Forms != null && contract.Forms.Count > 0)
                {
                    DCRAdminDetailSection    dcrAdminDetailSection = contract.Forms[0].SectionsList.FirstOrDefault(f => f.SectionName == DCRSectionName.DCRDETAILADMINSECTION) as DCRAdminDetailSection;
                    ApplicationStatusSection dcrApprovalSection    = contract.Forms[0].SectionsList.FirstOrDefault(f => f.SectionName == SectionNameConstant.APPLICATIONSTATUS) as ApplicationStatusSection;
                    if (dcrAdminDetailSection != null)
                    {
                        this.SetTranListintoTempData <VendorDCR>(dcrAdminDetailSection.VendorDCRList, TempKeys.DCRVendor.ToString() + "_" + id);
                        dcrAdminDetailSection.Division = dcrAdminDetailSection.Division.LastIndexOf(",") != -1 ? dcrAdminDetailSection.Division.TrimEnd(',') : dcrAdminDetailSection.Division;
                        if (dcrApprovalSection != null)
                        {
                            dcrAdminDetailSection.ApproversList               = dcrApprovalSection.ApplicationStatusList;
                            dcrAdminDetailSection.QAIComment                  = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.QAINCHARGE).Comments;
                            dcrAdminDetailSection.DCRProcessIComment          = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.DCRPROCESSINCHARGE).Comments;
                            dcrAdminDetailSection.DCRInchargeNavigatorComment = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.DCRINCHARGENAVIGATOR).Comments;
                            // dcrAdminDetailSection.DesignEngineerComment = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.DESIGNDEVELOPENGINEER).Comments;
                            dcrAdminDetailSection.DesignEngineerIComment = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.DESIGNENGINEERINCHARGE) != null?dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.DESIGNENGINEERINCHARGE).Comments : string.Empty;

                            dcrAdminDetailSection.SCMIComment         = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.SCMINCHARGE).Comments;
                            dcrAdminDetailSection.LUMIComment         = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.LUMMARKETINGINCHARGE).Comments;
                            dcrAdminDetailSection.KAPIComment         = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.KAPMARKETINGINCHARGE).Comments;
                            dcrAdminDetailSection.DAPIComment         = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.DAPMARKETINGINCHARGE).Comments;
                            dcrAdminDetailSection.FANIComment         = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.FANSMARKETINGINCHARGE).Comments;
                            dcrAdminDetailSection.LightingIComment    = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.LIGHTINGMARKETINGINCHARGE).Comments;
                            dcrAdminDetailSection.MRMarketingIComment = dcrAdminDetailSection.ApproversList.FirstOrDefault(p => p.Role == DCRRoles.MORPHYRICHARDSMARKETINGINCHARGE).Comments;
                        }
                    }
                    return(this.View(contract));
                }
                else
                {
                    return(this.RedirectToAction("NotAuthorize", "Master"));
                }
            }
            else
            {
                return(this.RedirectToAction("NotAuthorize", "Master"));
            }
        }
Esempio n. 2
0
        public ActionResult DCNAdminIndex(int id = 0)
        {
            if (id > 0 && DCRBusinessLayer.Instance.IsAdminUser(this.CurrentUser.UserId))
            {
                Dictionary <string, string> objDict = new Dictionary <string, string>();
                objDict.Add(Parameter.FROMNAME, FormNames.DCNADMINFORM);
                objDict.Add(Parameter.ITEMID, id.ToString());
                objDict.Add(Parameter.USEREID, this.CurrentUser.UserId);
                ViewBag.UserID   = this.CurrentUser.UserId;
                ViewBag.UserName = this.CurrentUser.FullName;
                DCNAdminContract dcnContract = this.GetDCNAdminDetails(objDict);
                dcnContract.UserDetails = this.CurrentUser;

                if (dcnContract != null)
                {
                    var form = dcnContract.Forms.FirstOrDefault();
                    if (form != null)
                    {
                        var dcnDetailAdminSection = form.SectionsList.FirstOrDefault(f => f.SectionName.Equals(DCNSectionName.DCNDETAILADMINSECTION)) as DCNDetailAdminSection;
                        ApplicationStatusSection dcnApprovalSection = dcnContract.Forms[0].SectionsList.FirstOrDefault(f => f.SectionName == SectionNameConstant.APPLICATIONSTATUS) as ApplicationStatusSection;
                        if (dcnDetailAdminSection != null)
                        {
                            this.SetTranListintoTempData <Specification>(dcnDetailAdminSection.Specification, TempKeys.Specification.ToString() + "_" + id);
                            this.SetTranListintoTempData <RevisedApplicableDocuments>(dcnDetailAdminSection.RevisedApplicable, TempKeys.RevisedApplicableDoc.ToString() + "_" + id);
                            this.SetTranListintoTempData <VendorDCN>(dcnDetailAdminSection.VendorDCRList, TempKeys.DCRVendor.ToString() + "_" + id);
                            this.SetTranListintoTempData <VendorDCN>(dcnDetailAdminSection.VendorDCNList, TempKeys.DCNVendor.ToString() + "_" + id);
                            if (dcnApprovalSection != null)
                            {
                                dcnDetailAdminSection.ApproversList      = dcnApprovalSection.ApplicationStatusList;
                                dcnDetailAdminSection.DCRProcessIComment = dcnDetailAdminSection.ApproversList.FirstOrDefault(p => p.Role == DCNRoles.DCRPROCESSINCHARGE).Comments;
                                dcnDetailAdminSection.SCMComment         = dcnDetailAdminSection.ApproversList.FirstOrDefault(p => p.Role == DCNRoles.SCM) != null?dcnDetailAdminSection.ApproversList.FirstOrDefault(p => p.Role == DCNRoles.SCM).Comments : string.Empty;

                                //dcnDetailAdminSection.DesignEngComment = dcnDetailAdminSection.ApproversList.FirstOrDefault(p => p.Role == DCNRoles.DESIGNENGINEER).Comments;
                            }
                        }
                    }
                    return(this.View(dcnContract));
                }
                else
                {
                    return(this.RedirectToAction("NotAuthorize", "Master"));
                }
            }
            else
            {
                return(this.RedirectToAction("NotAuthorize", "Master"));
            }
        }