Example #1
0
        public JsonResult ModifySectorData(Guid id)
        {
            string message    = "Sucess! Modified successfully";
            bool   isModified = true;
            PrioritySectorModel prioritySectorModel = new PrioritySectorModel();

            TSM.Entity.Sector sector = new Entity.Sector();
            //try
            //{
            sector = prioritySectorModel.GetSectorData(id);
            var sectorLanguage = sector.Sector_Languages.Where(sl => sl.LanguageID == TSM.Model.TSMContext.CurrentSiteLanguageID).FirstOrDefault();
            var Name           = sectorLanguage.Name;
            var sectorType     = sector.Type;
            var ITC            = sector.ITC_NomenclatureID;
            var INT            = sector.International_NomenclatureID;
            var ID             = sector.ID;

            //}
            //catch (Exception ex)
            //{
            //    ErrorLog.WriteLog("RecordController", "ModifySectorData", ex, id.ToString());
            //    message = "Failure! Unable to Modify";
            //    isModified = false;
            //}
            return(this.Json(new { message = message, isModified = isModified, Name = Name, sectorType = sectorType, ITC = ITC, INT = INT, id = ID }, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public JsonResult SavePrioritySector(PrioritySectorModel prioritySector)
        {
            string message    = "Sucess! Saved successfully";
            bool   isModified = true;
            string id         = string.Empty;

            try
            {
                TSM.Entity.Sector sector = prioritySector.Save();
                if (prioritySector.ID != Guid.Empty)
                {
                    id = sector.ID.ToString();
                }
                else
                {
                    id = sector.ID.ToString();
                }
            }
            catch (Exception ex)
            {
                ErrorLog.WriteLog("RecordController", "SavePrioritySector", ex, "");
                message    = "Failure! Unable to Save";
                isModified = false;
            }
            return(this.Json(new { message = message, isModified = isModified, id = id }, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        public JsonResult DeleteSectorData(Guid id)
        {
            string message   = "Sucess! Deleted successfully";
            bool   isDeleted = true;

            try
            {
                PrioritySectorModel prioritySectorModel = new PrioritySectorModel();
                prioritySectorModel.Delete(id);
            }

            catch (Exception ex)
            {
                ErrorLog.WriteLog("RecordController", "DeleteSectorData", ex, id.ToString());
                message   = "Failure! Unable to delete";
                isDeleted = false;
            }
            return(this.Json(new { message = message, isDeleted = isDeleted }, JsonRequestBehavior.AllowGet));
        }