public ActionResult View(int Id) { if (_workContext.CurrentUser == null || Session["UserId"] == null) { TempData["From"] = "S"; return(RedirectToAction("Login", "Login", new { area = "" })); } else { ViewBag.LicenseId = Id; if (Id != 0) { int _LicenceId = Id; ACS.Core.Domain.Product.AddendumDetails mobj_ProductLicense = _ProductLicenseService.GetAddendumDetailById(_LicenceId); if (mobj_ProductLicense != null) { ViewBag.AddendumId = mobj_ProductLicense.Id; } } ViewBag.ProductId = 0; if (_workContext.CurrentUser.DepartmentM.DepartmentCode == "AD" || _workContext.CurrentUser.DepartmentM.DepartmentCode == "SA") { //TempData["BackToserach"] = "BackToserach"; //return View("ProductLicense"); return(View("ViewOnly")); } else { TempData["BackToserach"] = "BackToserach"; return(View("ViewOnly")); } } }
public IHttpActionResult InsertAddendumFileDetails(ACS.Core.Domain.Product.AddendumDetails AddendumDetails) { if (AddendumDetails.Id > 0) { ACS.Core.Domain.Product.AddendumDetails mobj_AddendumDetails = _AddendumServices.GetAddendumDetailsById(AddendumDetails); 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); } mobj_AddendumDetails.IAddendumFileDetails = _IAddendumFileDetails; _AddendumServices.UpdateAddendumDetails(mobj_AddendumDetails); } return(Json("OK")); }
public IHttpActionResult getAddendumDetailsByAddendumId(ACS.Core.Domain.Product.AddendumDetails AddendumDetails) { ACS.Core.Domain.Product.AddendumDetails AddendumDetails1 = _AddendumServices.GetAddendumDetailsById(AddendumDetails); return(Json(SerializeObj.SerializeObject(new { AddendumDetails1 }))); }
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"); }
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"); }