Ejemplo n.º 1
0
        public IHttpActionResult getSubProductTypeList()
        {
            IList <ProductTypeMaster> subProductList = _CommonListService.GetSubProductType().ToList();

            var subProductData = subProductList.Select(p => new
            {
                subProductId   = p.Id,
                subProductName = p.typeName,
                productName    = p.ProductTypeM.typeName
            });

            return(Json(SerializeObj.SerializeObject(new { subProductData = subProductData })));

            //var leftList = (from emp in _ProductTypeMaster.Table.Where(a => a.Deactivate == "N")

            //                join d in _ProductMaster.Table.Where(a => a.Deactivate == "N")
            //                on emp.Id equals d.SubProductTypeId into output
            //                from j in output.DefaultIfEmpty()
            //                select new
            //                {
            //                    id = emp.Id,
            //                    typeName = emp.typeName,
            //                    Flag = j.SubProductTypeId != null ? "1" : "0",
            //                    TypeLavel = emp.typelevel,
            //                }).Distinct().Where(a => a.TypeLavel == 2);

            //return Json(leftList);
        }
Ejemplo n.º 2
0
        public IHttpActionResult ContactDetailById(string Id)
        {
            // call ACS.Services function for fetching contact details
            int ContactId = Convert.ToInt32(Id);

            ACS.Core.Domain.Master.ExecutiveMaster Executive = _contactService.GetContactDetailById(ContactId);
            return(Json(SerializeObj.SerializeObject(new { Executive.Id, Name = Executive.executiveName })));
        }
Ejemplo n.º 3
0
        public IHttpActionResult ImpressionDetailsListForLicense(ImpressionDetails ImpressionDetails)
        {
            //IList<ImpressionDetails> _ImpressionDetails = _AddendumServices.GetImpressionDetails(ImpressionDetails).ToList();

            SqlParameter[] parameters = new SqlParameter[3];
            parameters[0] = new SqlParameter("ProductId", SqlDbType.VarChar, 50);
            if (ImpressionDetails.ProductId == 0)
            {
                parameters[0].Value = System.Data.SqlTypes.SqlInt32.Null;
            }
            else
            {
                parameters[0].Value = ImpressionDetails.ProductId;
            }

            parameters[1] = new SqlParameter("LicenseId", SqlDbType.VarChar, 50);
            if (ImpressionDetails.LicenseId == 0)
            {
                parameters[1].Value = System.Data.SqlTypes.SqlInt32.Null;
            }
            else
            {
                parameters[1].Value = ImpressionDetails.LicenseId;
            }

            parameters[2] = new SqlParameter("ContractId", SqlDbType.VarChar, 50);
            if (ImpressionDetails.ContractId == 0)
            {
                parameters[2].Value = System.Data.SqlTypes.SqlInt32.Null;
            }
            else
            {
                parameters[2].Value = 0;
            }
            var _ImpressionDetailsList = _dbContext.ExecuteStoredProcedureListNewData <ImpressionDetailsListModel>("Proc_ImpressionDetailsList_get", parameters).ToList();

            var data = (from Impression in _ImpressionDetailsList
                        select new
            {
                ISBN = Impression.ISBN,
                ImpressionDate = Impression.ImpressionDate,
                QunatityPrinted = Impression.QunatityPrinted,
                BalanceQty = Impression.BalanceQty,
                AddendumId = Impression.AddendumId,
                //------------------------------------------------
                Licenseprintquantity = _ProductLicense.Table.Where(a => a.Deactivate == "N" && a.Id == ImpressionDetails.LicenseId).Select(a => a.printquantity).FirstOrDefault(),
                LicenseAddendumQuantity = _AddendumDetails.Table.Where(a => a.Deactivate == "N" && a.LicenseId == ImpressionDetails.LicenseId).Select(a => a.AddendumQuantity).ToList(),

                BalanceQuantityCarryForward = _AddendumDetails.Table.Where(a => a.Deactivate == "N" && a.LicenseId == ImpressionDetails.LicenseId).OrderByDescending(a => a.EntryDate).Select(a => a.BalanceQuantityCarryForward).FirstOrDefault(),
                LicenseAddendumQuantity1 = _AddendumDetails.Table.Where(a => a.Deactivate == "N" && a.LicenseId == ImpressionDetails.LicenseId && a.BalanceQuantityCarryForward == "N").OrderByDescending(a => a.EntryDate).Select(a => a.AddendumQuantity).FirstOrDefault(),
                CarryForwardAddendunId = _AddendumDetails.Table.Where(a => a.Deactivate == "N" && a.LicenseId == ImpressionDetails.LicenseId && a.BalanceQuantityCarryForward == "N").OrderByDescending(a => a.EntryDate).Select(a => a.Id).FirstOrDefault()
                                         //------------------------------------------------
            }).ToList();

            return(Json(SerializeObj.SerializeObject(data)));
        }
Ejemplo n.º 4
0
        public IHttpActionResult GetAllISBNBagList(int productType)
        {
            var _list = _CommonListService.GetAllISBNBagList().Where(a => a.Blocked == null && a.ProductTypeid == productType).ToList();
            var query = _list.Select(i => new
            {
                Id   = i.Id,
                ISBN = i.ISBN,
            }).OrderBy(a => a.Id);

            return(Json(SerializeObj.SerializeObject(new { query })));
        }
Ejemplo n.º 5
0
        public IHttpActionResult GetISBNList(ProductTypeMaster Ptype)
        {
            var _list = _CommonListService.GetAllISBNByProductTypeId(Ptype.Id).Where(a => a.Blocked == null).ToList();
            var query = _list.Select(i => new
            {
                Id   = i.Id,
                ISBN = i.ISBN,
            }).OrderBy(a => a.Id);

            return(Json(SerializeObj.SerializeObject(new { query })));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Description	      :SubDevision List By DevisionId
        /// Function Name     :SubDivisionListByDivisionId
        /// OutPut parameter  :DataSet
        /// Create Date	      : 11 May 2016
        /// Author Name	      : Vishal Verma
        /// </summary>
        /// <remarks>
        ///****************************  Modification History  *************************************************************
        /// Sr No:	Date		    Modified by	    Tracker                 Description
        ///*****************************************************************************************************************
        ///*****************************************************************************************************************
        ///
        ///</remarks>
        public IHttpActionResult SubDivisionListByDivisionId(DivisionMaster Division)
        {
            IList <DivisionMaster> _divisionList = _CommonListService.GetAllSubDivisionsbyDivisonId(Division).ToList();
            var divisionData = _divisionList.Select(dl => new
            {
                SubDivisionId   = dl.Id,
                SubDivisionName = dl.divisionName
            });

            return(Json(SerializeObj.SerializeObject(new { divisionData = divisionData })));
        }
Ejemplo n.º 7
0
        public IHttpActionResult WebGetaCUrrencyByDefault()
        {
            CurrencyMaster _currency = _CurrencyMaster.Table.Where(a => a.Symbol == "INR" && a.Deactivate == "N").FirstOrDefault();

            var _currencyList = new
            {
                CurrencyCode = _currency.Id
            };


            return(Json(SerializeObj.SerializeObject(new { _currencyList })));
        }
Ejemplo n.º 8
0
        public IHttpActionResult GetProductISBNList()
        {
            //var query1 = _CommonListService.GetProductISBNList().ToList().Select(i => new
            //{
            //    Id = i.Id,
            //    ISBN = i.OUPISBN,
            //}).OrderBy(a => a.Id);

            var query = _dbContext.ExecuteStoredProcedureListNewData <ProductISBN>("Proc_GetProductISBNList_get").ToList();

            return(Json(SerializeObj.SerializeObject(new { query })));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Description	      :Series List by SubDivisionId
        /// Function Name     :Series List by SubDivisionId
        /// OutPut parameter  :DataSet
        /// Create Date	      : 23 May 2016
        /// Author Name	      : Vishal Verma
        /// </summary>
        /// <remarks>
        ///****************************  Modification History  *************************************************************
        /// Sr No:	Date		    Modified by	    Tracker                 Description
        ///*****************************************************************************************************************
        ///*****************************************************************************************************************
        ///
        ///</remarks>
        public IHttpActionResult SeriesListbyDivisionSubDivisionId(SeriesMaster Series)
        {
            IList <SeriesMaster> _SeriesList = _CommonListService.GetSeriesList(Series).Where(x => x.Deactivate == "N").ToList();
            var SeriesData = _SeriesList.Select(sr => new
            {
                SeriesId   = sr.Id,
                Id         = sr.Id,
                SeriesName = sr.Seriesname
            });

            return(Json(SerializeObj.SerializeObject(new { SeriesData })));
        }
Ejemplo n.º 10
0
        public IHttpActionResult getAuthorList()
        {
            var query = _CommonListService.GetAllAuthor().ToList().Select(i => new
            {
                Id        = i.Id,
                FirstName = i.FirstName,
                LastName  = i.LastName
            });

            query = query.OrderBy(x => x.FirstName);

            return(Json(SerializeObj.SerializeObject(new { query })));
        }
Ejemplo n.º 11
0
        public IHttpActionResult getSubProductTypeList()
        {
            IList <ProductTypeMaster> subProductList = _productTypeService.GetSubProductType().ToList();

            var subProductData = subProductList.Select(p => new
            {
                subProductId   = p.Id,
                subProductName = p.typeName,
                productName    = p.ProductTypeM.typeName
            });

            return(Json(SerializeObj.SerializeObject(new { subProductData = subProductData })));
        }
Ejemplo n.º 12
0
        //

        ////Added by Saddam on 09/05/2016
        //[HttpGet]
        //public IHttpActionResult getAuthorList()
        //{
        //    return Json(_CommonListService.GetAllAuthor().ToList());
        //}


        public IHttpActionResult AuthorSuggesationList(AuthorMaster AuthorMaster)
        {
            IList <AuthorMaster> _AuthorList = _CommonListService.GetAuthorSuggesationList(AuthorMaster).ToList();
            var AuthorSuggesation            = _AuthorList.Select(Au => new
            {
                AuthorId      = Au.Id,
                AuthorName    = Au.FirstName + " " + Au.LastName,
                AuthorCode    = Au.AuthorCode,
                AuthorSAPCode = Au.AuthorSAPCode,
            });

            return(Json(SerializeObj.SerializeObject(new { AuthorSuggesation })));
        }
Ejemplo n.º 13
0
 public IHttpActionResult SubServiceListByServiceId(string ServiceId)
 {
     if (ServiceId != "undefined" && ServiceId != "")
     {
         var query = _CommonListService.GetAllSubServiceListByServiceId(int.Parse(ServiceId)).ToList();
         return(Json(SerializeObj.SerializeObject(new { query })));
     }
     else
     {
         ServiceId = "0";
         var query = _CommonListService.GetAllSubServiceListByServiceId(int.Parse(ServiceId)).ToList();
         return(Json(SerializeObj.SerializeObject(new { query })));
     }
 }
Ejemplo n.º 14
0
        public IHttpActionResult WebGetProprietorById(ACS.Core.Domain.Master.CustomProduct Proprietor)
        {
            mobj_proprietorMaster = new ProprietorMaster();

            mobj_proprietorMaster.Id = Proprietor.Id;

            mobj_proprietorMaster = _CustomProductService.getcustomproductbyid(mobj_proprietorMaster);

            Proprietor.Id = mobj_proprietorMaster.Id;

            Proprietor.ProprietorISBN = mobj_proprietorMaster.ProprietorISBN;

            Proprietor.ProprietorProduct       = mobj_proprietorMaster.ProprietorProduct;
            Proprietor.ProprietorEdition       = mobj_proprietorMaster.ProprietorEdition;
            Proprietor.ProprietorCopyrightYear = mobj_proprietorMaster.ProprietorCopyrightYear;



            Proprietor.PublishingCompanyId   = mobj_proprietorMaster.PublishingCompanyId;
            Proprietor.ProprietorPubCenterId = mobj_proprietorMaster.ProprietorPubCenterId;
            Proprietor.ProprietorImPrintId   = mobj_proprietorMaster.ProprietorImPrintId;

            Proprietor.AuthorId = mobj_proprietorMaster.ProprietorAuthorLink
                                  .Where(x => x.Deactivate == "N")
                                  .Select(x => x.AuthorId).FirstOrDefault().ToString();

            Proprietor.AuthorIdList = mobj_proprietorMaster.ProprietorAuthorLink
                                      .Where(x => x.Deactivate == "N")
                                      .AsEnumerable()
                                      .Select(x => x.AuthorId.ToString())
                                      .ToArray();

            Proprietor.AuthorId = string.Join(",", Proprietor.AuthorIdList);


            //     return Json(Proprietor);

            IList <ProprietorAuthorLink> _ProprietorAuthorList = mobj_proprietorMaster.ProprietorAuthorLink.ToList();
            var ProprietorAuthor = _ProprietorAuthorList.Select(pu => new
            {
                AuthorId   = pu.AuthorId,
                AuthorName = pu.ProprietorAuthorLinkAuthor.FirstName + " " + pu.ProprietorAuthorLinkAuthor.LastName,
            });

            return(Json(SerializeObj.SerializeObject(new { Proprietor, ProprietorAuthor })));
        }
Ejemplo n.º 15
0
        public IHttpActionResult WebGetExecutiveById(ExecutiveMaster Executive)
        {
            ACS.Core.Domain.Master.ExecutiveMaster _Executive = _ExecutiveService.GetExecutiveById(Executive.Id);
            var reporting     = _Executive.ExecutiveReportings.Where(i => i.Deactivate == "N").ToList().FirstOrDefault();
            var divisionLinks = _Executive.ExecutiveDivisionLinks.Where(a => a.Deactivate == "N").ToList();
            var query         = new
            {
                Password      = _encryptionService.DecryptText(_Executive.Password, _ExecutiveService.KeyValue("encriptionkey")),
                Executivename = _Executive.executiveName,
                Email         = _Executive.Emailid,
                Phone         = _Executive.Phoneno,
                Mobile        = _Executive.Mobile,
                DepartmentId  = _Executive.DepartmentId,
                Id            = _Executive.Id,
                Code          = _Executive.executivecode
            };


            return(Json(SerializeObj.SerializeObject(new { query, reporting, divisionLinks })));
        }
Ejemplo n.º 16
0
        public IHttpActionResult getAddendumDetailsByLicenseId(int LicenseId)
        {
            IList <AddendumDetails> AddendumDetails1 = _AddendumServices.GetAddendumDetailsByLicenseId(LicenseId);

            var AddendumDetails = (from Addendum in AddendumDetails1
                                   select new
            {
                Id = Addendum.Id,
                LicenseId = Addendum.LicenseId,
                AddendumCode = Addendum.AddendumCode,
                AddendumDate = Addendum.AddendumDate.toDDMMYYYY(),
                AddendumQuantity = Addendum.AddendumQuantity,
                ExpiryDate = Addendum.ExpiryDate == null? null : Convert.ToDateTime(Addendum.ExpiryDate).toDDMMYYYY(),
                Addendum_Type = Addendum.AddendumType,
                //AddendumFileName = Addendum.IAddendumFileDetails.FirstOrDefault().FileName,
                //AddendumUploadFileName = Addendum.IAddendumFileDetails.FirstOrDefault().UploadFileName,
            }).ToList();

            return(Json(SerializeObj.SerializeObject(new { AddendumDetails })));
        }
Ejemplo n.º 17
0
        // function for fetching contact details basis on contactId
        public IHttpActionResult ContactById(ACS.Core.Domain.Master.ExecutiveMaster Executive)
        {
            // call ACS.Services function for fetching contact details
            ACS.Core.Domain.Master.ExecutiveMaster _contactData = _contactService.GetContactDetailById(Executive.Id);



            return(Json(SerializeObj.SerializeObject(new
            {
                Id = _contactData.Id,


                FirstName = _contactData.executiveName,
                Email = _contactData.Emailid,
                Password = _contactData.Password,
                Mobile = _contactData.Mobile,
                Phone = _contactData.Phoneno,
                DeptId = _contactData.DepartmentId,
                Proc_Trns_To = _contactData.ProcessTransferTo,
            })));
        }
Ejemplo n.º 18
0
        public IHttpActionResult TopSearch(String Code)
        {
            OtherContractMaster OtherContract = _OtherContractMaster.Table.Where(a => a.othercontractcode == Code && a.Deactivate == "N").FirstOrDefault();


            if (OtherContract != null)
            {
                var _OtherContract = new
                {
                    othercontractcode = OtherContract.Id
                };


                return(Json(SerializeObj.SerializeObject(new { _OtherContract })));
            }
            else
            {
                string _OtherContract = string.Empty;
                return(Json(SerializeObj.SerializeObject(new { _OtherContract })));
            }
        }
Ejemplo n.º 19
0
        public IHttpActionResult ImpressionDetails(ImpressionDetails ImpressionDetails)
        {
            IList <ImpressionDetails> _ImpressionDetails = _AddendumServices.GetImpressionDetails(ImpressionDetails).ToList();

            var data = (from Impression in _ImpressionDetails
                        select new
            {
                ImpressionDate = Impression.ImpressionDate.toDDMMYYYY(),
                QunatityPrinted = Impression.QunatityPrinted,
                //ExpiryDate = Addendum.ExpiryDate == null ? null : Convert.ToDateTime(Addendum.ExpiryDate).toDDMMYYYY()
                BalanceQty = Impression.BalanceQty,
                AddendumId = Impression.AddendumId,
                //------------------------------------------------
                Licenseprintquantity = _ProductLicense.Table.Where(a => a.Deactivate == "N" && a.Id == ImpressionDetails.LicenseId).Select(a => a.printquantity).FirstOrDefault(),
                LicenseAddendumQuantity = _AddendumDetails.Table.Where(a => a.Deactivate == "N" && a.LicenseId == ImpressionDetails.LicenseId).Select(a => a.AddendumQuantity).ToList(),

                BalanceQuantityCarryForward = _AddendumDetails.Table.Where(a => a.Deactivate == "N" && a.LicenseId == ImpressionDetails.LicenseId).OrderByDescending(a => a.EntryDate).Select(a => a.BalanceQuantityCarryForward).FirstOrDefault(),
                LicenseAddendumQuantity1 = _AddendumDetails.Table.Where(a => a.Deactivate == "N" && a.LicenseId == ImpressionDetails.LicenseId && a.BalanceQuantityCarryForward == "N").OrderByDescending(a => a.EntryDate).Select(a => a.AddendumQuantity).FirstOrDefault(),
                CarryForwardAddendunId = _AddendumDetails.Table.Where(a => a.Deactivate == "N" && a.LicenseId == ImpressionDetails.LicenseId && a.BalanceQuantityCarryForward == "N").OrderByDescending(a => a.EntryDate).Select(a => a.Id).FirstOrDefault()
                                         //------------------------------------------------
            }).ToList();

            return(Json(SerializeObj.SerializeObject(data)));
        }
Ejemplo n.º 20
0
        public IHttpActionResult getImprint(int Id)
        {
            ImprintMaster _imprintMaster = _imprintService.GetImprintById(Id);

            return(Json(SerializeObj.SerializeObject(new { _imprintMaster })));
        }
Ejemplo n.º 21
0
        public IHttpActionResult getTerriteryRights()
        {
            var query = _CommonListService.TerriteryRights().ToList();

            return(Json(SerializeObj.SerializeObject(new { query })));
        }
Ejemplo n.º 22
0
        public IHttpActionResult getGeographical(int Id)
        {
            GeographicalMaster _geographicalMaster = _geographicalService.GetGeographicalById(Id);

            return(Json(SerializeObj.SerializeObject(new { _geographicalMaster })));
        }
Ejemplo n.º 23
0
        public IHttpActionResult getAuthorTypeList()
        {
            var query = _CommonListService.GetAllAuthorTypeList().ToList();

            return(Json(SerializeObj.SerializeObject(new { query })));
        }
Ejemplo n.º 24
0
        public IHttpActionResult OtherContractSerchView(Contract_Signed_By_Executive OtherContract)
        {
            SqlParameter[] parameters = new SqlParameter[1];



            parameters[0] = new SqlParameter("OthercontractId", SqlDbType.VarChar, 50);
            if (OtherContract.Id == null)
            {
                parameters[0].Value = System.Data.SqlTypes.SqlInt32.Null;
            }
            else
            {
                parameters[0].Value = OtherContract.Id;
            }



            var _GetOtherContractSearch = _dbContext.ExecuteStoredProcedureListNewData <Contract_Signed_By_Executive>("Proc_OtherContractList_get", parameters).ToList();


            var OtherContractDivisionLink = (from OCDL in _OtherContractDivisionLink.Table.Where(a => a.Deactivate == "N")
                                             join DM in _DivisionMaster.Table.Where(a => a.Deactivate == "N")
                                             on OCDL.divisionid equals DM.Id

                                             select new
            {
                divisionid = OCDL.divisionid,
                divisionName = DM.divisionName,
                othercontractid = OCDL.othercontractid
            }

                                             ).Distinct().Where(a => a.othercontractid == OtherContract.Id).ToList();


            OtherContractImageBank _ContractImageBank = _OtherContractImageBank.Table.Where(a => a.othercontractid == OtherContract.Id && a.Deactivate == "N").FirstOrDefault();

            Contract_Signed_By_Executive OtherContractDocuments = new Contract_Signed_By_Executive();

            var documents = _OtherContractDocuments.Table.Where(a => a.othercontractid == OtherContract.Id && a.Deactivate == "N").ToList();


            OtherContractDocuments.DocumentIds = documents.Select(i => i.Id).ToArray();


            OtherContractDocuments.Documentname = documents.Select(i => i.Documentname).ToArray();
            foreach (var docs in documents)
            {
                OtherContractDocuments.documentfile = OtherContractDocuments.documentfile + docs.documentfile + ",";
            }


            OtherContractLink _OtherContractLintList = _OtherContractLink.Table.Where(a => a.othercontractid == OtherContract.Id && a.Deactivate == "N").FirstOrDefault();

            Contract_Signed_By_Executive OtherContractDocuments2 = new Contract_Signed_By_Executive();

            if (_OtherContractLintList != null)
            {
                var documents2 = _OtherContractLinkDocument.Table.Where(a => a.othercontractLinkid == _OtherContractLintList.Id && a.Deactivate == "N").ToList();


                OtherContractDocuments2.DocumentlinkIds = documents2.Select(i => i.Id).ToArray();


                OtherContractDocuments2.DocumentnameLink = documents2.Select(i => i.DocumentnameLink).ToArray();
                foreach (var docs in documents2)
                {
                    OtherContractDocuments2.documentfileLink = OtherContractDocuments2.documentfileLink + docs.documentfileLink + ",";
                }
            }
            else
            {
                OtherContractDocuments2 = new Contract_Signed_By_Executive();
            }

            if (_ContractImageBank != null)
            {
                var ImageTypeOtherContact = (from VIBL in _VideoImageBank.Table.Where(a => a.Deactivate == "N" && a.Type == "I")
                                             join CM in _CurrencyMaster.Table.Where(a => a.Deactivate == "N")
                                             on VIBL.CurrencyId equals CM.Id
                                             select new
                {
                    Fullname = VIBL.Fullname,
                    Cost = VIBL.Cost,
                    Currency = CM.CurrencyName,
                    CurrencySymbol = CM.Symbol,
                    CurrencyId = VIBL.CurrencyId,
                    ImageBankId = VIBL.ImageBankId
                }).Distinct().Where(a => a.ImageBankId == _ContractImageBank.Id).ToList();

                var VideoTypeOtherContact = (from VIBL in _VideoImageBank.Table.Where(a => a.Deactivate == "N" && a.Type == "V")
                                             join CM in _CurrencyMaster.Table.Where(a => a.Deactivate == "N")
                                             on VIBL.CurrencyId equals CM.Id
                                             select new
                {
                    Fullname = VIBL.Fullname,
                    Cost = VIBL.Cost,
                    Currency = CM.CurrencyName,
                    CurrencySymbol = CM.Symbol,
                    CurrencyId = VIBL.CurrencyId,
                    ImageBankId = VIBL.ImageBankId
                }
                                             ).Distinct().Where(a => a.ImageBankId == _ContractImageBank.Id).ToList();

                return(Json(SerializeObj.SerializeObject(new { _GetOtherContractSearch, OtherContractDivisionLink, ImageTypeOtherContact, VideoTypeOtherContact, OtherContractDocuments, OtherContractDocuments2 })));
            }
            else
            {
                var ImageTypeOtherContact = new { };
                var VideoTypeOtherContact = new { };
                return(Json(SerializeObj.SerializeObject(new { _GetOtherContractSearch, OtherContractDivisionLink, ImageTypeOtherContact, VideoTypeOtherContact, OtherContractDocuments, OtherContractDocuments2 })));
            }



            //   return Json(_GetOtherContractSearch);
        }
Ejemplo n.º 25
0
        public IHttpActionResult InsertAddendumDetails(ACS.Core.Domain.Product.AddendumDetails AddendumDetails)
        {
            int    AddendumId = 0;
            string status     = string.Empty;
            IList <AddendumRoyaltySlab> _IAddendumRoyaltySlab = new List <AddendumRoyaltySlab>();

            ProductLicense License = _ProductLicenseService.GetProductLicenseById(AddendumDetails.LicenseId);

            AddendumDetails.BalanceQuantity = AddendumDetails.AddendumQuantity;

            if (License.printquantitytype == "Number")
            {
                if (AddendumDetails.BalanceQuantityCarryForward == "Y")
                {
                    AddendumDetails.BalanceQuantity = AddendumDetails.BalanceQuantity + Convert.ToInt32(License.balanceqty);
                }
            }

            foreach (AddendumRoyaltySlab RoyaltySlab in AddendumDetails.AddendumDetailsRoyalty)
            {
                // Author Details Set
                AddendumRoyaltySlab _AddendumRoyaltySlab = new AddendumRoyaltySlab();
                _AddendumRoyaltySlab.ProductSubTypeId = RoyaltySlab.ProductSubTypeId;
                _AddendumRoyaltySlab.copiesfrom       = RoyaltySlab.copiesfrom;
                _AddendumRoyaltySlab.copiesto         = RoyaltySlab.copiesto;
                _AddendumRoyaltySlab.percentage       = RoyaltySlab.percentage;
                _AddendumRoyaltySlab.Deactivate       = "N";
                _AddendumRoyaltySlab.EnteredBy        = AddendumDetails.EnteredBy;
                _AddendumRoyaltySlab.EntryDate        = DateTime.Now;
                _AddendumRoyaltySlab.ModifiedBy       = null;
                _AddendumRoyaltySlab.ModifiedDate     = null;
                _AddendumRoyaltySlab.DeactivateBy     = null;
                _AddendumRoyaltySlab.DeactivateDate   = null;
                _IAddendumRoyaltySlab.Add(_AddendumRoyaltySlab);
            }


            ACS.Core.Domain.Product.AddendumDetails _AddendumDetails = new ACS.Core.Domain.Product.AddendumDetails();
            _AddendumDetails.LicenseId    = AddendumDetails.LicenseId;
            _AddendumDetails.ProductId    = AddendumDetails.ProductId;
            _AddendumDetails.AddendumDate = AddendumDetails.AddendumDate;
            _AddendumDetails.AddendumType = AddendumDetails.AddendumType;
            //_AddendumDetails.Periodofagreement = AddendumDetails.Periodofagreement;
            _AddendumDetails.ExpiryDate = AddendumDetails.ExpiryDate;
            _AddendumDetails.FirstImpressionWithinDate   = AddendumDetails.FirstImpressionWithinDate;
            _AddendumDetails.NoOfImpressions             = AddendumDetails.NoOfImpressions;
            _AddendumDetails.BalanceQuantityCarryForward = AddendumDetails.BalanceQuantityCarryForward;
            _AddendumDetails.AddendumQuantity            = AddendumDetails.AddendumQuantity;
            _AddendumDetails.BalanceQuantity             = AddendumDetails.BalanceQuantity;
            _AddendumDetails.RoyaltyTerms           = AddendumDetails.RoyaltyTerms;
            _AddendumDetails.Remarks                = AddendumDetails.Remarks;
            _AddendumDetails.AddendumDetailsRoyalty = _IAddendumRoyaltySlab;
            _AddendumDetails.Deactivate             = "N";
            _AddendumDetails.EnteredBy              = AddendumDetails.EnteredBy;
            _AddendumDetails.EntryDate              = DateTime.Now;
            _AddendumDetails.ModifiedBy             = null;
            _AddendumDetails.ModifiedDate           = null;
            _AddendumDetails.DeactivateBy           = null;
            _AddendumDetails.DeactivateDate         = null;
            AddendumId = _AddendumServices.InsertAddendumDetails(_AddendumDetails);

            if (AddendumId > 0 && License.printquantitytype == "Number")
            {
                License.balanceqty   = _AddendumDetails.BalanceQuantity;
                License.ModifiedBy   = AddendumDetails.EnteredBy;
                License.ModifiedDate = DateTime.Now;
                _ProductLicenseService.UpdateProductLicenseMaster(License);
            }

            // Addendum Details Set
            ACS.Core.Domain.Product.ProductLicenseAddendumLink _ProductLicenseAddendumLink = new ACS.Core.Domain.Product.ProductLicenseAddendumLink();
            _ProductLicenseAddendumLink.AddendumId     = AddendumId;
            _ProductLicenseAddendumLink.ProductId      = AddendumDetails.ProductId;
            _ProductLicenseAddendumLink.LicenseId      = AddendumDetails.LicenseId;
            _ProductLicenseAddendumLink.Active         = "Y";
            _ProductLicenseAddendumLink.Deactivate     = "N";
            _ProductLicenseAddendumLink.EnteredBy      = AddendumDetails.EnteredBy;
            _ProductLicenseAddendumLink.EntryDate      = DateTime.Now;
            _ProductLicenseAddendumLink.ModifiedBy     = null;
            _ProductLicenseAddendumLink.ModifiedDate   = null;
            _ProductLicenseAddendumLink.DeactivateBy   = null;
            _ProductLicenseAddendumLink.DeactivateDate = null;
            _ProductLicenseService.InsertMultipleProductLink(_ProductLicenseAddendumLink);



            IList <AddendumFileDetails> _IAddendumFileDetails = new List <AddendumFileDetails>();



            foreach (AddendumFileDetails FileDetails in AddendumDetails.IAddendumFileDetails)
            {
                // Author Details Set
                AddendumFileDetails _AddendumFileDetails = new AddendumFileDetails();
                _AddendumFileDetails.AddendumId     = AddendumId;
                _AddendumFileDetails.LicenseId      = FileDetails.LicenseId;
                _AddendumFileDetails.FileName       = FileDetails.FileName;
                _AddendumFileDetails.UploadFileName = FileDetails.UploadFileName;
                _AddendumFileDetails.Deactivate     = "N";
                _AddendumFileDetails.EnteredBy      = AddendumDetails.EnteredBy;
                _AddendumFileDetails.EntryDate      = DateTime.Now;
                _AddendumFileDetails.ModifiedBy     = null;
                _AddendumFileDetails.ModifiedDate   = null;
                _AddendumFileDetails.DeactivateBy   = null;
                _AddendumFileDetails.DeactivateDate = null;
                //_IAddendumFileDetails.Add(_AddendumFileDetails);

                _AddendumServices.InsertAddendumFileDetails(_AddendumFileDetails);
            }
            status = "OK";
            return(Json(SerializeObj.SerializeObject(new { status, AddendumId })));

            //return Json("OK");
        }
Ejemplo n.º 26
0
        public IHttpActionResult WebGetaOtherContractById(OtherContractMaster OtherContract)
        {
            int ImageBankId = 0;

            OtherContractMaster _OtherContract = _OtherContractService.GetOtherContractMasterById(OtherContract);
            var OtherContractList = new
            {
                Id                   = _OtherContract.Id,
                partyname            = _OtherContract.partyname,
                natureofserviceid    = _OtherContract.natureofserviceid,
                natureofsubserviceid = _OtherContract.natureofsubserviceid,
                Address              = _OtherContract.Address,
                CountryId            = _OtherContract.CountryId,
                OtherCountry         = _OtherContract.OtherCountry,
                Stateid              = _OtherContract.Stateid,
                OtherState           = _OtherContract.OtherState,
                Cityid               = _OtherContract.Cityid,
                OtherCity            = _OtherContract.OtherCity,
                Pincode              = _OtherContract.Pincode,
                Mobile               = _OtherContract.Mobile,
                Email                = _OtherContract.Email,
                PANNo                = _OtherContract.PANNo,
                Requestdate          = _OtherContract.Requestdate,
                ProjectTitle         = _OtherContract.ProjectTitle,
                ProjectISBN          = _OtherContract.ProjectISBN,
                Contracttypeid       = _OtherContract.Contracttypeid,
                //  ContractDate = _OtherContract.ContractDate,
                //    Periodofagreement = _OtherContract.Periodofagreement,
                //    Expirydate = _OtherContract.Expirydate,
                Territoryrightsid = _OtherContract.Territoryrightsid,
                Payment           = _OtherContract.Payment,
                paymentperiodid   = _OtherContract.paymentperiodid,
                NatureOfWork      = _OtherContract.NatureOfWork,
                //   divisionid = _OtherContract.divisionid,
                ContractSignedByExecutiveid = _OtherContract.ContractSignedByExecutiveid,
                Remarks          = _OtherContract.Remarks,
                PaymentAmount    = _OtherContract.PaymentAmount,
                CurrencyMasterId = _OtherContract.CurrencyMasterId,
            };


            //    var OtherContractDivisionLink = _OtherContractDivisionLink.Table.Where(a => a.othercontractid == _OtherContract.Id && a.Deactivate == "N").ToList();

            var OtherContractDivisionLink = (from OCDL in _OtherContractDivisionLink.Table.Where(a => a.Deactivate == "N")
                                             join DM in _DivisionMaster.Table.Where(a => a.Deactivate == "N")
                                             on OCDL.divisionid equals DM.Id

                                             select new
            {
                divisionid = OCDL.divisionid,
                divisionName = DM.divisionName,
                othercontractid = OCDL.othercontractid
            }

                                             ).Distinct().Where(a => a.othercontractid == _OtherContract.Id).ToList();

            OtherContractImageBank _ContractImageBank = _OtherContractImageBank.Table.Where(a => a.othercontractid == _OtherContract.Id && a.Deactivate == "N").FirstOrDefault();


            if (_ContractImageBank != null)
            {
                ImageBankId = _ContractImageBank.Id;
            }
            IList <VideoImageBank> ImageTypeOtherContact = _VideoImageBank.Table.Where(a => a.Deactivate == "N" && a.ImageBankId == ImageBankId && a.Type == "I").ToList();
            IList <VideoImageBank> VideoTypeOtherContact = _VideoImageBank.Table.Where(a => a.Deactivate == "N" && a.ImageBankId == ImageBankId && a.Type == "V").ToList();



            if (_ContractImageBank != null)
            {
                var _ContractImageBankList = new
                {
                    Id = _ContractImageBank.Id,
                    Printrunquantity = _ContractImageBank.Printrunquantity,
                    PrintRights      = _ContractImageBank.PrintRights,
                    electronicrights = _ContractImageBank.electronicrights,
                    ebookrights      = _ContractImageBank.ebookrights,
                    cost             = _ContractImageBank.cost,
                    currencyid       = _ContractImageBank.currencyid,
                    restriction      = _ContractImageBank.restriction,
                    othercontractid  = _ContractImageBank.othercontractid,
                };
            }



            Contract_Signed_By_Executive OtherContractDocuments = new Contract_Signed_By_Executive();

            var documents = _OtherContractDocuments.Table.Where(a => a.othercontractid == _OtherContract.Id && a.Deactivate == "N").ToList();


            OtherContractDocuments.DocumentIds = documents.Select(i => i.Id).ToArray();


            OtherContractDocuments.Documentname = documents.Select(i => i.Documentname).ToArray();
            foreach (var docs in documents)
            {
                OtherContractDocuments.documentfile = OtherContractDocuments.documentfile + docs.documentfile + ",";
            }



            OtherContractLink            _OtherContractLintList  = _OtherContractLink.Table.Where(a => a.othercontractid == _OtherContract.Id && a.Deactivate == "N").FirstOrDefault();
            Contract_Signed_By_Executive OtherContractDocuments2 = new Contract_Signed_By_Executive();

            if (_OtherContractLintList != null)
            {
                var OtherConractlinkData = new
                {
                    Contractstatus                = _OtherContractLintList.Contractstatus,
                    Signed_Contract_Sent_Date     = _OtherContractLintList.SignedContractSentDate,
                    Signed_Contract_received_Date = _OtherContractLintList.SignedContractReceived_Date,
                    Cancellation_Date             = _OtherContractLintList.CancellationDate,
                    Cancellation_Reason           = _OtherContractLintList.Cancellation_Reason,
                    PendingRemarks                = _OtherContractLintList.Remarks
                };



                var documents2 = _OtherContractLinkDocument.Table.Where(a => a.othercontractLinkid == _OtherContractLintList.Id && a.Deactivate == "N").ToList();


                OtherContractDocuments2.DocumentlinkIds = documents2.Select(i => i.Id).ToArray();


                OtherContractDocuments2.DocumentnameLink = documents2.Select(i => i.DocumentnameLink).ToArray();
                foreach (var docs in documents2)
                {
                    OtherContractDocuments2.documentfileLink = OtherContractDocuments2.documentfileLink + docs.documentfileLink + ",";
                }
            }



            return(Json(SerializeObj.SerializeObject(new { _OtherContract, _ContractImageBank, OtherContractDocuments, _OtherContractLintList, OtherContractDocuments2, OtherContractDivisionLink, ImageTypeOtherContact, VideoTypeOtherContact })));
        }
Ejemplo n.º 27
0
        public IHttpActionResult InsertOtherContract(Contract_Signed_By_Executive OtherContract)
        {
            string status            = "";
            int    OtherContractIdId = 0;
            string OtherContactCode  = string.Empty;

            try
            {
                //if (status == "Y")
                //{
                if (OtherContract.Id == 0)
                {
                    IList <ApplicationSetUp> _ApplicationSetUpList = _ApplicationSetUp.Table.Where(x => x.key == "Other Contract" && x.Deactivate == "N").ToList();
                    var OtherContractSuggesation = _ApplicationSetUpList.Select(Au => new
                    {
                        OtherContractValue = Au.keyValue,
                        Id = Au.Id
                    });

                    IList <ContractType> _ContractTypeList = _ContractType.Table.Where(x => x.Id == OtherContract.Contracttypeid && x.Deactivate == "N").ToList();
                    var ContractType = _ContractTypeList.Select(CT => new
                    {
                        ContractName = CT.ContractName
                    });

                    OtherContractMaster _OtherContract = new OtherContractMaster();


                    string   stringTokens = ContractType.FirstOrDefault().ContractName;
                    string   strVlaue     = string.Empty;
                    string[] words;
                    if (stringTokens.Contains("-"))
                    {
                        words = stringTokens.Split('-');
                    }
                    else
                    {
                        words = stringTokens.Split(' ');
                    }


                    foreach (string word in words)
                    {
                        strVlaue += word.FirstOrDefault();
                    }

                    _OtherContract.othercontractcode = "OC" + strVlaue.ToString() + OtherContractSuggesation.FirstOrDefault().OtherContractValue;
                    _OtherContract.othercontractcode = _OtherContract.othercontractcode.ToString().ToUpper();
                    OtherContactCode = _OtherContract.othercontractcode.ToString().ToUpper();

                    _OtherContract.partyname            = OtherContract.partyname;
                    _OtherContract.natureofserviceid    = OtherContract.natureofserviceid;
                    _OtherContract.natureofsubserviceid = OtherContract.natureofsubserviceid;
                    _OtherContract.Address        = OtherContract.Address;
                    _OtherContract.CountryId      = OtherContract.CountryId;
                    _OtherContract.OtherCountry   = OtherContract.OtherCountry;
                    _OtherContract.Stateid        = OtherContract.Stateid;
                    _OtherContract.OtherState     = OtherContract.OtherState;
                    _OtherContract.Cityid         = OtherContract.Cityid;
                    _OtherContract.OtherCity      = OtherContract.OtherCity;
                    _OtherContract.Pincode        = OtherContract.Pincode;
                    _OtherContract.Mobile         = OtherContract.Mobile;
                    _OtherContract.Email          = OtherContract.Email;
                    _OtherContract.PANNo          = OtherContract.PANNo;
                    _OtherContract.Requestdate    = OtherContract.Requestdate;
                    _OtherContract.ProjectTitle   = OtherContract.ProjectTitle;
                    _OtherContract.ProjectISBN    = OtherContract.ProjectISBN;
                    _OtherContract.Contracttypeid = OtherContract.Contracttypeid;
                    // _OtherContract.ContractDate = OtherContract.ContractDate;
                    //  _OtherContract.Periodofagreement = OtherContract.Periodofagreement;
                    //  _OtherContract.Expirydate = OtherContract.Expirydate;
                    _OtherContract.Territoryrightsid = OtherContract.Territoryrightsid;
                    _OtherContract.Payment           = OtherContract.Payment;
                    _OtherContract.paymentperiodid   = OtherContract.paymentperiodid;
                    _OtherContract.NatureOfWork      = OtherContract.NatureOfWork;
                    // _OtherContract.divisionid = OtherContract.divisionid;
                    _OtherContract.ContractSignedByExecutiveid = OtherContract.ContractSignedByExecutiveid;
                    _OtherContract.Remarks          = OtherContract.Remarks;
                    _OtherContract.EnteredBy        = OtherContract.EnteredBy;
                    _OtherContract.PaymentAmount    = OtherContract.PaymentAmount;
                    _OtherContract.CurrencyMasterId = OtherContract.CurrencyMasterId;

                    OtherContractIdId = _OtherContractService.InsertOtherContract(_OtherContract);

                    if (OtherContractIdId != 0)
                    {
                        OtherContractDivisionLink DivisionLink = new OtherContractDivisionLink();
                        int k = 0;
                        foreach (var item in OtherContract.Division)
                        {
                            DivisionLink.othercontractid = OtherContractIdId;
                            DivisionLink.divisionid      = item;
                            DivisionLink.EnteredBy       = OtherContract.EnteredBy;
                            _OtherContractService.InsertOtherContractDivisionLink(DivisionLink);
                            k++;
                        }


                        OtherContractDocuments _OtherContractDoc = new OtherContractDocuments();

                        string[] docurl = OtherContract.documentfile.Split(',');
                        int      i      = 0;
                        foreach (string doc in OtherContract.Documentname)
                        {
                            OtherContractDocuments Link = new OtherContractDocuments();
                            Link.othercontractid = OtherContractIdId;
                            Link.Documentname    = doc;
                            Link.documentfile    = docurl[i];
                            Link.EnteredBy       = OtherContract.EnteredBy;
                            _OtherContractService.InsertOtherContractDocumentsLinking(Link);
                            i++;
                        }

                        if (OtherContract.ForImageBank == "1")
                        {
                            /* Added by dheeraj Kumar sharma */
                            OtherContractImageBank _OtherContractImageBank = new OtherContractImageBank();
                            IList <VideoImageBank> ImageBankList           = new List <VideoImageBank>();

                            if (OtherContract.VideoImageBank.Count > 0)
                            {
                                foreach (var obj in OtherContract.VideoImageBank)
                                {
                                    VideoImageBank obj_VideoImageBank = new VideoImageBank();
                                    obj_VideoImageBank.Type       = obj.Type;
                                    obj_VideoImageBank.ShortName  = obj.ShortName;
                                    obj_VideoImageBank.Fullname   = obj.Fullname;
                                    obj_VideoImageBank.CurrencyId = obj.CurrencyId;
                                    obj_VideoImageBank.Cost       = obj.Cost;
                                    obj_VideoImageBank.Deactivate = "N";
                                    obj_VideoImageBank.EnteredBy  = OtherContract.EnteredBy;
                                    obj_VideoImageBank.EntryDate  = DateTime.Now;
                                    ImageBankList.Add(obj_VideoImageBank);
                                }
                            }
                            _OtherContractImageBank.VideoImageBank = ImageBankList;
                            /*End by dheeraj*/
                            _OtherContractImageBank.Printrunquantity = OtherContract.Printrunquantity;
                            _OtherContractImageBank.PrintRights      = OtherContract.PrintRights;
                            _OtherContractImageBank.electronicrights = OtherContract.electronicrights;
                            _OtherContractImageBank.ebookrights      = OtherContract.ebookrights;
                            _OtherContractImageBank.cost             = OtherContract.cost;
                            _OtherContractImageBank.currencyid       = OtherContract.currencyid;
                            _OtherContractImageBank.restriction      = OtherContract.restriction;

                            _OtherContractImageBank.othercontractid = OtherContractIdId;
                            _OtherContractImageBank.EnteredBy       = OtherContract.EnteredBy;
                            _OtherContractService.InsertOtherContractImageBank(_OtherContractImageBank);
                        }
                    }


                    OtherContractLink _OtherContractLink1 = new OtherContractLink();
                    _OtherContractLink1.Contractstatus              = null;
                    _OtherContractLink1.SignedContractSentDate      = null;
                    _OtherContractLink1.SignedContractReceived_Date = null;
                    _OtherContractLink1.CancellationDate            = null;
                    _OtherContractLink1.Cancellation_Reason         = null;
                    _OtherContractLink1.othercontractid             = OtherContractIdId;
                    _OtherContractLink1.Status    = "Pending";
                    _OtherContractLink1.EnteredBy = OtherContract.EnteredBy;
                    _OtherContractLink1.Remarks   = OtherContract.PendingRemarks;

                    int OtherContractLinkIdId = _OtherContractService.InsertOtherContractLink(_OtherContractLink1);


                    ApplicationSetUp Mobj_ApplicationSetUp = new ApplicationSetUp();

                    Mobj_ApplicationSetUp.Id = OtherContractSuggesation.FirstOrDefault().Id;

                    ApplicationSetUp _ApplicationSetUpUpdate = _ApplicationSetUpService.GetApplicationSetUpById(Mobj_ApplicationSetUp);

                    _ApplicationSetUpUpdate.Id = OtherContractSuggesation.FirstOrDefault().Id;
                    int Value = Int32.Parse(OtherContractSuggesation.FirstOrDefault().OtherContractValue) + 1;

                    _ApplicationSetUpUpdate.keyValue = Value.ToString().PadLeft(4, '0');

                    _ApplicationSetUpUpdate.ModifiedBy   = OtherContract.EnteredBy;
                    _ApplicationSetUpUpdate.ModifiedDate = DateTime.Now;

                    _ApplicationSetUpService.UpdateApplication(_ApplicationSetUpUpdate);
                }
                else
                {
                    if (OtherContract.UpdateRight == "rt" || OtherContract.UpdateRight == "fc")
                    {
                        OtherContractLink mobj_OtherContractLink = _OtherContractLink.Table.Where(i => i.othercontractid == OtherContract.Id && i.Deactivate == "N").FirstOrDefault();

                        if (mobj_OtherContractLink != null)
                        {
                            mobj_OtherContractLink.Contractstatus              = OtherContract.Contractstatus;
                            mobj_OtherContractLink.SignedContractSentDate      = OtherContract.SignedContractSentDate;
                            mobj_OtherContractLink.SignedContractReceived_Date = OtherContract.SignedContractReceived_Date;
                            mobj_OtherContractLink.CancellationDate            = OtherContract.CancellationDate;
                            mobj_OtherContractLink.Cancellation_Reason         = OtherContract.Cancellation_Reason;
                            mobj_OtherContractLink.othercontractid             = OtherContract.Id;
                            mobj_OtherContractLink.ModifiedBy = OtherContract.EnteredBy;
                            mobj_OtherContractLink.Status     = OtherContract.Contractstatus;
                            mobj_OtherContractLink.Remarks    = OtherContract.PendingRemarks;

                            mobj_OtherContractLink.AgreementDate = OtherContract.AgreementDate;
                            mobj_OtherContractLink.Effectivedate = OtherContract.Effectivedate;
                            //mobj_OtherContractLink.Contractperiodinmonth = OtherContract.Contractperiodinmonth;

                            mobj_OtherContractLink.Expirydate = OtherContract.Expirydate;

                            _OtherContractService.UpdateOtherContractLink(mobj_OtherContractLink);


                            OtherContractLinkDocument _OtherContractDocLink = new OtherContractLinkDocument();

                            string[] docurl1 = OtherContract.documentfileLink.Split(',');
                            int      i       = 0;
                            foreach (string doc in OtherContract.DocumentnameLink)
                            {
                                OtherContractLinkDocument Link = new OtherContractLinkDocument();
                                Link.othercontractLinkid = mobj_OtherContractLink.Id;
                                Link.DocumentnameLink    = doc;
                                Link.documentfileLink    = docurl1[i];
                                Link.EnteredBy           = OtherContract.EnteredBy;
                                _OtherContractService.InsertOtherContractDocumentsLinkingLink(Link);
                                i++;
                            }
                        }
                    }
                    else if (OtherContract.UpdateRight == "ad" || OtherContract.UpdateRight == "sa")
                    {
                        OtherContractMaster mobj_OtherDocument = _OtherContractService.GetOtherContractMasterId(OtherContract.Id);

                        mobj_OtherDocument.partyname            = OtherContract.partyname;
                        mobj_OtherDocument.natureofserviceid    = OtherContract.natureofserviceid;
                        mobj_OtherDocument.natureofsubserviceid = OtherContract.natureofsubserviceid;
                        mobj_OtherDocument.Address        = OtherContract.Address;
                        mobj_OtherDocument.CountryId      = OtherContract.CountryId;
                        mobj_OtherDocument.OtherCountry   = OtherContract.OtherCountry;
                        mobj_OtherDocument.Stateid        = OtherContract.Stateid;
                        mobj_OtherDocument.OtherState     = OtherContract.OtherState;
                        mobj_OtherDocument.Cityid         = OtherContract.Cityid;
                        mobj_OtherDocument.OtherCity      = OtherContract.OtherCity;
                        mobj_OtherDocument.Pincode        = OtherContract.Pincode;
                        mobj_OtherDocument.Mobile         = OtherContract.Mobile;
                        mobj_OtherDocument.Email          = OtherContract.Email;
                        mobj_OtherDocument.PANNo          = OtherContract.PANNo;
                        mobj_OtherDocument.Requestdate    = OtherContract.Requestdate;
                        mobj_OtherDocument.ProjectTitle   = OtherContract.ProjectTitle;
                        mobj_OtherDocument.ProjectISBN    = OtherContract.ProjectISBN;
                        mobj_OtherDocument.Contracttypeid = OtherContract.Contracttypeid;
                        //  mobj_OtherDocument.ContractDate = OtherContract.ContractDate;
                        //  mobj_OtherDocument.Periodofagreement = OtherContract.Periodofagreement;
                        //  mobj_OtherDocument.Expirydate = OtherContract.Expirydate;
                        mobj_OtherDocument.Territoryrightsid = OtherContract.Territoryrightsid;
                        mobj_OtherDocument.Payment           = OtherContract.Payment;
                        mobj_OtherDocument.paymentperiodid   = OtherContract.paymentperiodid;
                        mobj_OtherDocument.NatureOfWork      = OtherContract.NatureOfWork;
                        //  mobj_OtherDocument.divisionid = OtherContract.divisionid;
                        mobj_OtherDocument.ContractSignedByExecutiveid = OtherContract.ContractSignedByExecutiveid;
                        mobj_OtherDocument.Remarks          = OtherContract.Remarks;
                        mobj_OtherDocument.ModifiedBy       = OtherContract.EnteredBy;
                        mobj_OtherDocument.PaymentAmount    = OtherContract.PaymentAmount;
                        mobj_OtherDocument.CurrencyMasterId = OtherContract.CurrencyMasterId;

                        _OtherContractService.UpdateOtherContractMaster(mobj_OtherDocument);

                        _OtherContractService.DeleteOtherContractDivisionLink(OtherContract.Id, OtherContract.EnteredBy);

                        OtherContractDivisionLink DivisionLink = new OtherContractDivisionLink();
                        int k = 0;
                        foreach (var item in OtherContract.Division)
                        {
                            DivisionLink.othercontractid = OtherContract.Id;
                            DivisionLink.divisionid      = item;
                            DivisionLink.EnteredBy       = OtherContract.EnteredBy;
                            _OtherContractService.InsertOtherContractDivisionLink(DivisionLink);
                            k++;
                        }


                        OtherContractImageBank mobj_OtherContractImageBank = _OtherContractImageBank.Table.Where(i => i.othercontractid == OtherContract.Id && i.Deactivate == "N").FirstOrDefault();

                        if (mobj_OtherContractImageBank != null)
                        {
                            _OtherContractService.DeleteVideoImageBankLink(mobj_OtherContractImageBank.Id, OtherContract.EnteredBy);

                            if (OtherContract.VideoImageBank.Count > 0)
                            {
                                int m = 0;



                                foreach (var obj in OtherContract.VideoImageBank)
                                {
                                    VideoImageBank obj_VideoImageBank = new VideoImageBank();
                                    obj_VideoImageBank.Type        = obj.Type;
                                    obj_VideoImageBank.ShortName   = obj.ShortName;
                                    obj_VideoImageBank.Fullname    = obj.Fullname;
                                    obj_VideoImageBank.CurrencyId  = obj.CurrencyId;
                                    obj_VideoImageBank.Cost        = obj.Cost;
                                    obj_VideoImageBank.ImageBankId = mobj_OtherContractImageBank.Id;
                                    obj_VideoImageBank.EnteredBy   = OtherContract.EnteredBy;
                                    obj_VideoImageBank.EntryDate   = DateTime.Now;
                                    obj_VideoImageBank.Deactivate  = "N";
                                    _OtherContractService.InsertVideoImageBankLink(obj_VideoImageBank);
                                    m++;
                                }
                            }

                            mobj_OtherContractImageBank.Printrunquantity = OtherContract.Printrunquantity;
                            mobj_OtherContractImageBank.PrintRights      = OtherContract.PrintRights;
                            mobj_OtherContractImageBank.electronicrights = OtherContract.electronicrights;
                            mobj_OtherContractImageBank.ebookrights      = OtherContract.ebookrights;
                            mobj_OtherContractImageBank.cost             = OtherContract.cost;
                            mobj_OtherContractImageBank.currencyid       = OtherContract.currencyid;
                            mobj_OtherContractImageBank.restriction      = OtherContract.restriction;

                            mobj_OtherContractImageBank.othercontractid = OtherContract.Id;
                            mobj_OtherContractImageBank.ModifiedBy      = OtherContract.EnteredBy;
                            _OtherContractService.UpdateOtherContractImageBank(mobj_OtherContractImageBank);
                        }

                        else if (OtherContract.ForImageBank == "1")
                        {
                            //OtherContractImageBank _OtherConImageBank = new OtherContractImageBank();
                            //_OtherConImageBank.Printrunquantity = OtherContract.Printrunquantity;
                            //_OtherConImageBank.PrintRights = OtherContract.PrintRights;
                            //_OtherConImageBank.electronicrights = OtherContract.electronicrights;
                            //_OtherConImageBank.ebookrights = OtherContract.ebookrights;
                            //_OtherConImageBank.cost = OtherContract.cost;
                            //_OtherConImageBank.currencyid = OtherContract.currencyid;
                            //_OtherConImageBank.restriction = OtherContract.restriction;

                            //_OtherConImageBank.othercontractid = OtherContract.Id;
                            //_OtherConImageBank.EnteredBy = OtherContract.EnteredBy;
                            //_OtherContractService.InsertOtherContractImageBank(_OtherConImageBank);

                            OtherContractImageBank _OtherConImageBank = new OtherContractImageBank();
                            IList <VideoImageBank> ImageBankList      = new List <VideoImageBank>();

                            if (OtherContract.VideoImageBank.Count > 0)
                            {
                                foreach (var obj in OtherContract.VideoImageBank)
                                {
                                    VideoImageBank obj_VideoImageBank = new VideoImageBank();
                                    obj_VideoImageBank.Type       = obj.Type;
                                    obj_VideoImageBank.ShortName  = obj.ShortName;
                                    obj_VideoImageBank.Fullname   = obj.Fullname;
                                    obj_VideoImageBank.CurrencyId = obj.CurrencyId;
                                    obj_VideoImageBank.Cost       = obj.Cost;
                                    obj_VideoImageBank.Deactivate = "N";
                                    obj_VideoImageBank.EnteredBy  = OtherContract.EnteredBy;
                                    obj_VideoImageBank.EntryDate  = DateTime.Now;
                                    ImageBankList.Add(obj_VideoImageBank);
                                }
                            }
                            _OtherConImageBank.VideoImageBank = ImageBankList;
                            /*End by dheeraj*/
                            _OtherConImageBank.Printrunquantity = OtherContract.Printrunquantity;
                            _OtherConImageBank.PrintRights      = OtherContract.PrintRights;
                            _OtherConImageBank.electronicrights = OtherContract.electronicrights;
                            _OtherConImageBank.ebookrights      = OtherContract.ebookrights;
                            _OtherConImageBank.cost             = OtherContract.cost;
                            _OtherConImageBank.currencyid       = OtherContract.currencyid;
                            _OtherConImageBank.restriction      = OtherContract.restriction;

                            _OtherConImageBank.othercontractid = OtherContract.Id;
                            _OtherConImageBank.EnteredBy       = OtherContract.EnteredBy;
                            _OtherContractService.InsertOtherContractImageBank(_OtherConImageBank);
                        }


                        OtherContractDocuments _OtherContractDoc = new OtherContractDocuments();

                        string[] docurl = OtherContract.documentfile.Split(',');
                        int      j      = 0;
                        foreach (string doc in OtherContract.Documentname)
                        {
                            OtherContractDocuments Link = new OtherContractDocuments();
                            Link.othercontractid = OtherContract.Id;
                            Link.Documentname    = doc;
                            Link.documentfile    = docurl[j];
                            Link.EnteredBy       = OtherContract.EnteredBy;
                            _OtherContractService.InsertOtherContractDocumentsLinking(Link);
                            j++;
                        }


                        OtherContractLink mobj_OtherContractLink = _OtherContractLink.Table.Where(i => i.othercontractid == OtherContract.Id && i.Deactivate == "N").FirstOrDefault();

                        if (mobj_OtherContractLink != null)
                        {
                            mobj_OtherContractLink.Contractstatus              = OtherContract.Contractstatus;
                            mobj_OtherContractLink.SignedContractSentDate      = OtherContract.SignedContractSentDate;
                            mobj_OtherContractLink.SignedContractReceived_Date = OtherContract.SignedContractReceived_Date;
                            mobj_OtherContractLink.CancellationDate            = OtherContract.CancellationDate;
                            mobj_OtherContractLink.Cancellation_Reason         = OtherContract.Cancellation_Reason;
                            mobj_OtherContractLink.othercontractid             = OtherContract.Id;
                            mobj_OtherContractLink.ModifiedBy = OtherContract.EnteredBy;
                            mobj_OtherContractLink.Status     = OtherContract.Contractstatus;
                            mobj_OtherContractLink.Remarks    = OtherContract.PendingRemarks;

                            mobj_OtherContractLink.AgreementDate = OtherContract.AgreementDate;
                            mobj_OtherContractLink.Effectivedate = OtherContract.Effectivedate;
                            //mobj_OtherContractLink.Contractperiodinmonth = OtherContract.Contractperiodinmonth;

                            mobj_OtherContractLink.Expirydate = OtherContract.Expirydate;

                            _OtherContractService.UpdateOtherContractLink(mobj_OtherContractLink);


                            OtherContractLinkDocument _OtherContractDocLink = new OtherContractLinkDocument();

                            string[] docurl1 = OtherContract.documentfileLink.Split(',');
                            int      i       = 0;
                            foreach (string doc in OtherContract.DocumentnameLink)
                            {
                                OtherContractLinkDocument Link = new OtherContractLinkDocument();
                                Link.othercontractLinkid = mobj_OtherContractLink.Id;
                                Link.DocumentnameLink    = doc;
                                Link.documentfileLink    = docurl1[i];
                                Link.EnteredBy           = OtherContract.EnteredBy;
                                _OtherContractService.InsertOtherContractDocumentsLinkingLink(Link);
                                i++;
                            }
                        }
                    }

                    //-------------------------------------------
                    OtherContractIdId = OtherContract.Id;
                    OtherContactCode  = _OtherContractMaster.Table.Where(a => a.Id == OtherContract.Id).Select(b => b.othercontractcode).SingleOrDefault();
                }
                status = _localizationService.GetResource("Master.API.Success.Message");
            }
            catch (ACSException ex)
            {
                status = ex.ToString();
            }
            catch (Exception ex)
            {
                status = ex.ToString();
            }
            return(Json(SerializeObj.SerializeObject(new { status, OtherContactCode, OtherContractIdId })));
        }
Ejemplo n.º 28
0
        public IHttpActionResult getSubsidiaryRights(int Id)
        {
            SubsidiaryRightsMaster _SubsidiaryRightsMaster = _subsidiaryRightsService.GetSubsidiaryRightsById(Id);

            return(Json(SerializeObj.SerializeObject(new { _SubsidiaryRightsMaster })));
        }
Ejemplo n.º 29
0
        public IHttpActionResult getAddendumDetailsByAddendumId(ACS.Core.Domain.Product.AddendumDetails AddendumDetails)
        {
            ACS.Core.Domain.Product.AddendumDetails AddendumDetails1 = _AddendumServices.GetAddendumDetailsById(AddendumDetails);

            return(Json(SerializeObj.SerializeObject(new { AddendumDetails1 })));
        }
Ejemplo n.º 30
0
        public IHttpActionResult UpdateAddendumDetails(ACS.Core.Domain.Product.AddendumDetails AddendumDetails)
        {
            string status = string.Empty;

            if (AddendumDetails.Id > 0)
            {
                ACS.Core.Domain.Product.AddendumDetails mobj_AddendumDetails = _AddendumServices.GetAddendumDetailsById(AddendumDetails);
                List <AddendumRoyaltySlab> _IOldAddendumDetailsRoyalty       = mobj_AddendumDetails.AddendumDetailsRoyalty.ToList();
                List <AddendumFileDetails> _IOldAddendumFileDetails          = mobj_AddendumDetails.IAddendumFileDetails.ToList();

                foreach (AddendumRoyaltySlab Royality in _IOldAddendumDetailsRoyalty)
                {
                    _AddendumServices.DeleteAddendumRoyaltySlab(Royality);
                }

                foreach (AddendumFileDetails FileDetails in _IOldAddendumFileDetails)
                {
                    _AddendumServices.DeleteAddendumFileDetails(FileDetails);
                }

                IList <AddendumRoyaltySlab> _IAddendumRoyaltySlab = new List <AddendumRoyaltySlab>();


                foreach (AddendumRoyaltySlab RoyaltySlab in AddendumDetails.AddendumDetailsRoyalty)
                {
                    // Author Details Set
                    AddendumRoyaltySlab _AddendumRoyaltySlab = new AddendumRoyaltySlab();
                    _AddendumRoyaltySlab.ProductSubTypeId = RoyaltySlab.ProductSubTypeId;
                    _AddendumRoyaltySlab.copiesfrom       = RoyaltySlab.copiesfrom;
                    _AddendumRoyaltySlab.copiesto         = RoyaltySlab.copiesto;
                    _AddendumRoyaltySlab.percentage       = RoyaltySlab.percentage;
                    _AddendumRoyaltySlab.Deactivate       = "N";
                    _AddendumRoyaltySlab.EnteredBy        = AddendumDetails.EnteredBy;
                    _AddendumRoyaltySlab.EntryDate        = DateTime.Now;
                    _AddendumRoyaltySlab.ModifiedBy       = null;
                    _AddendumRoyaltySlab.ModifiedDate     = null;
                    _AddendumRoyaltySlab.DeactivateBy     = null;
                    _AddendumRoyaltySlab.DeactivateDate   = null;
                    _IAddendumRoyaltySlab.Add(_AddendumRoyaltySlab);
                }

                IList <AddendumFileDetails> _IAddendumFileDetails = new List <AddendumFileDetails>();



                foreach (AddendumFileDetails FileDetails in AddendumDetails.IAddendumFileDetails)
                {
                    // Author Details Set
                    AddendumFileDetails _AddendumFileDetails = new AddendumFileDetails();
                    _AddendumFileDetails.AddendumId     = FileDetails.AddendumId;
                    _AddendumFileDetails.LicenseId      = FileDetails.LicenseId;
                    _AddendumFileDetails.FileName       = FileDetails.FileName;
                    _AddendumFileDetails.UploadFileName = FileDetails.UploadFileName;
                    _AddendumFileDetails.Deactivate     = "N";
                    _AddendumFileDetails.EnteredBy      = AddendumDetails.EnteredBy;
                    _AddendumFileDetails.EntryDate      = DateTime.Now;
                    _AddendumFileDetails.ModifiedBy     = null;
                    _AddendumFileDetails.ModifiedDate   = null;
                    _AddendumFileDetails.DeactivateBy   = null;
                    _AddendumFileDetails.DeactivateDate = null;
                    _IAddendumFileDetails.Add(_AddendumFileDetails);
                }


                ACS.Core.Domain.Product.AddendumDetails _AddendumDetails = new ACS.Core.Domain.Product.AddendumDetails();

                mobj_AddendumDetails.AddendumDate = AddendumDetails.AddendumDate;
                mobj_AddendumDetails.AddendumType = AddendumDetails.AddendumType;
                //mobj_AddendumDetails.Periodofagreement = AddendumDetails.Periodofagreement;
                mobj_AddendumDetails.ExpiryDate = AddendumDetails.ExpiryDate;
                mobj_AddendumDetails.FirstImpressionWithinDate   = AddendumDetails.FirstImpressionWithinDate;
                mobj_AddendumDetails.NoOfImpressions             = AddendumDetails.NoOfImpressions;
                mobj_AddendumDetails.BalanceQuantityCarryForward = AddendumDetails.BalanceQuantityCarryForward;
                mobj_AddendumDetails.AddendumQuantity            = AddendumDetails.AddendumQuantity;
                mobj_AddendumDetails.RoyaltyTerms           = AddendumDetails.RoyaltyTerms;
                mobj_AddendumDetails.Remarks                = AddendumDetails.Remarks;
                mobj_AddendumDetails.AddendumDetailsRoyalty = _IAddendumRoyaltySlab;
                mobj_AddendumDetails.IAddendumFileDetails   = _IAddendumFileDetails;
                mobj_AddendumDetails.ModifiedBy             = AddendumDetails.EnteredBy;
                mobj_AddendumDetails.ModifiedDate           = DateTime.Now;
                _AddendumServices.UpdateAddendumDetails(_AddendumDetails);
            }


            status = "OK";
            return(Json(SerializeObj.SerializeObject(new { status })));
            //return Json("OK");
        }