Ejemplo n.º 1
0
        public ActionResult Index(int id = 0, int?DCRID = 0)
        {
            {
                Dictionary <string, string> objDict = new Dictionary <string, string>();
                objDict.Add(Parameter.FROMNAME, FormNameConstants.DCNFORM);
                objDict.Add(Parameter.ITEMID, id.ToString());
                objDict.Add(Parameter.USEREID, this.CurrentUser.UserId);
                ViewBag.UserID   = this.CurrentUser.UserId;
                ViewBag.UserName = this.CurrentUser.FullName;
                IContract contract = this.GetDCNDetails(objDict);
                contract.UserDetails = this.CurrentUser;
                DCNContract dcnContract = contract as DCNContract;
                if (dcnContract != null)
                {
                    var form = dcnContract.Forms.FirstOrDefault();
                    if (form != null)
                    {
                        var designdocSection = form.SectionsList.FirstOrDefault(f => f.SectionName.Equals(DCNSectionName.DESIGNENGINEERSECTION)) as BEL.DCRDCNWorkflow.Models.DCN.DesignEngineerSection;
                        if (designdocSection != null)
                        {
                            this.SetTranListintoTempData <Specification>(designdocSection.Specification, TempKeys.Specification.ToString() + "_" + id);
                            this.SetTranListintoTempData <RevisedApplicableDocuments>(designdocSection.RevisedApplicable, TempKeys.RevisedApplicableDoc.ToString() + "_" + id);
                            this.SetTranListintoTempData <VendorDCN>(designdocSection.VendorDCRList, TempKeys.DCRVendor.ToString() + "_" + id);
                        }

                        var qaIncharge = form.SectionsList.FirstOrDefault(f => f.SectionName.Equals(DCNSectionName.QAINCHARGESECTION)) as DCNQAInchargeSection;
                        if (qaIncharge != null)
                        {
                            this.SetTranListintoTempData <VendorDCN>(qaIncharge.VendorDCNList, TempKeys.DCNVendor.ToString() + "_" + id);
                        }
                    }
                }
                return(this.View(contract));
            }
        }
Ejemplo n.º 2
0
        public IContract GetDCNDetails(IDictionary <string, string> objDict)
        {
            DCNContract        contract = new DCNContract();
            BELDataAccessLayer helper   = new BELDataAccessLayer();

            if (objDict != null && objDict.ContainsKey(Parameter.FROMNAME) && objDict.ContainsKey(Parameter.ITEMID) && objDict.ContainsKey(Parameter.USEREID))
            {
                string formName = objDict[Parameter.FROMNAME];
                int    itemId   = Convert.ToInt32(objDict[Parameter.ITEMID]);
                string userID   = objDict[Parameter.USEREID];
                IForm  dcnForm  = new DCNForm(true);
                dcnForm = helper.GetFormData(this.context, this.web, ApplicationNameConstants.DCRAPP, formName, itemId, userID, dcnForm);
                if (dcnForm != null && dcnForm.SectionsList != null && dcnForm.SectionsList.Count > 0)
                {
                    ////Print Button Hide not required for GET DCN Detail Method
                    ////var sectionDetails = dcnForm.SectionsList.FirstOrDefault(f => f.SectionName.Equals(DCNSectionName.DESIGNDOCUMENTENGINEERSECTION)) as DesignDocumentEngineerSection;
                    ////if (sectionDetails != null)
                    ////{
                    ////    if (itemId != 0)
                    ////    {
                    ////        if ((sectionDetails.Status == FormStatus.COMPLETED || sectionDetails.Status == FormStatus.REJECTED) && sectionDetails.ApproversList.Any(p => p.Role == DCNRoles.DCRPROCESSINCHARGE && p.Approver != userID))
                    ////        {
                    ////            if (dcnForm.Buttons.FirstOrDefault(p => p.Name == "Print") != null)
                    ////            {
                    ////                dcnForm.Buttons.FirstOrDefault(p => p.Name == "Print").IsVisible = false;
                    ////            }
                    ////        }
                    ////    }
                    ////}
                    contract.Forms.Add(dcnForm);
                }
            }
            return(contract);
        }