Exemple #1
0
        /// <summary>
        /// Api method to delete ManuscriptDeliveryFormatMaster
        /// </summary>
        /// <param name="mobjManuscriptDeliveryFormat">accepts ManuscriptDeliveryFormatMaster object as paramater </param>
        /// <returns></returns>
        public IHttpActionResult ManuscriptDeliveryFormatDelete(ManuscriptDeliveryFormatMaster mobjManuscriptDeliveryFormat)
        {
            string message = string.Empty;

            try
            {
                ManuscriptDeliveryFormatMaster _mobjManuscriptDeliveryFormat = _mobjManuscriptDeliveryFormatService.GetManuscriptDeliveryFormatById(mobjManuscriptDeliveryFormat);
                _mobjManuscriptDeliveryFormat.Deactivate     = "Y";
                _mobjManuscriptDeliveryFormat.DeactivateBy   = mobjManuscriptDeliveryFormat.EnteredBy;
                _mobjManuscriptDeliveryFormat.DeactivateDate = DateTime.Now;
                _mobjManuscriptDeliveryFormatService.UpdateManuscriptDeliveryFormat(_mobjManuscriptDeliveryFormat);

                message = "OK";
            }
            catch (ACSException ex)
            {
                //message = ex.InnerException.Message;
                _mobjLoggerService.Error(ex.InnerException.Message, ex);
                message = _mobjLocalizationService.GetResource("Common.API.Exception.Message");
            }
            catch (Exception ex)
            {
                //message = ex.InnerException.Message;
                _mobjLoggerService.Error(ex.InnerException.Message, ex);
                message = _mobjLocalizationService.GetResource("Common.API.Exception.Message");
            }

            return(Json(message));
        }
Exemple #2
0
 /// <summary>
 /// Method to insert ManuscriptDeliveryFormatMaster
 /// </summary>
 /// <param name="ManuscriptDeliveryFormat">accepts ManuscriptDeliveryFormatMaster object as parameter</param>
 public void InsertManuscriptDeliveryFormat(ManuscriptDeliveryFormatMaster ManuscriptDeliveryFormat)
 {
     ManuscriptDeliveryFormat.Deactivate     = "N";
     ManuscriptDeliveryFormat.EntryDate      = DateTime.Now;
     ManuscriptDeliveryFormat.ModifiedBy     = null;
     ManuscriptDeliveryFormat.ModifiedDate   = null;
     ManuscriptDeliveryFormat.DeactivateBy   = null;
     ManuscriptDeliveryFormat.DeactivateDate = null;
     _ManuscriptDeliveryFormatRepository.Insert(ManuscriptDeliveryFormat);
 }
Exemple #3
0
        /// <summary>
        /// Method to check duplicate value
        /// </summary>
        /// <param name="ManuscriptDeliveryFormat">accepts ManuscriptDeliveryFormatMaster object as parameter</param>
        /// <returns>returns string</returns>
        public string DuplicateCheck(ManuscriptDeliveryFormatMaster ManuscriptDeliveryFormat)
        {
            var duplicate = _ManuscriptDeliveryFormatRepository.Table.Where(x => x.ManuscriptDeliveryFormat == ManuscriptDeliveryFormat.ManuscriptDeliveryFormat &&
                                                                            x.Deactivate == "N" &&
                                                                            (ManuscriptDeliveryFormat.Id != 0 ? x.Id : 0) != (ManuscriptDeliveryFormat.Id != 0 ? ManuscriptDeliveryFormat.Id : 1)).FirstOrDefault();

            if (duplicate != null)
            {
                return("N");
            }
            else
            {
                return("Y");
            }
        }
Exemple #4
0
        /// <summary>
        /// Api method to insert ManuscriptDeliveryFormatMaster
        /// </summary>
        /// <param name="mobjManuscriptDeliveryFormat">accepts ManuscriptDeliveryFormatMaster object as paramater </param>
        /// <returns></returns>
        public IHttpActionResult InsertManuscriptDeliveryFormat(ManuscriptDeliveryFormatMaster mobjManuscriptDeliveryFormat)
        {
            string message = "";

            try
            {
                message = _mobjManuscriptDeliveryFormatService.DuplicateCheck(mobjManuscriptDeliveryFormat);
                if (message == "Y")
                {
                    if (mobjManuscriptDeliveryFormat.Id == 0)
                    {
                        _mobjManuscriptDeliveryFormatService.InsertManuscriptDeliveryFormat(mobjManuscriptDeliveryFormat);
                        message = _mobjLocalizationService.GetResource("Master.API.Success.Message");
                    }
                    else
                    {
                        ManuscriptDeliveryFormatMaster _mobjManuscriptDeliveryFormat = _mobjManuscriptDeliveryFormatService.GetManuscriptDeliveryFormatById(mobjManuscriptDeliveryFormat);
                        _mobjManuscriptDeliveryFormat.ManuscriptDeliveryFormat = mobjManuscriptDeliveryFormat.ManuscriptDeliveryFormat;
                        _mobjManuscriptDeliveryFormat.ModifiedBy   = mobjManuscriptDeliveryFormat.EnteredBy;
                        _mobjManuscriptDeliveryFormat.ModifiedDate = DateTime.Now;
                        _mobjManuscriptDeliveryFormatService.UpdateManuscriptDeliveryFormat(_mobjManuscriptDeliveryFormat);
                        message = _mobjLocalizationService.GetResource("Master.API.Success.Message");
                    }
                }
                else
                {
                    message = "Duplicate";
                }
            }
            catch (ACSException ex)
            {
                //message = ex.InnerException.Message;
                _mobjLoggerService.Error(ex.InnerException.Message, ex);
                message = _mobjLocalizationService.GetResource("Common.API.Exception.Message");
            }
            catch (Exception ex)
            {
                //message = ex.InnerException.Message;
                _mobjLoggerService.Error(ex.InnerException.Message, ex);
                message = _mobjLocalizationService.GetResource("Common.API.Exception.Message");
            }

            return(Json(message));
        }
Exemple #5
0
 /// <summary>
 /// Method to update ManuscriptDeliveryFormatMaster
 /// </summary>
 /// <param name="ManuscriptDeliveryFormat">accepts ManuscriptDeliveryFormatMaster object as parameter</param>
 public void UpdateManuscriptDeliveryFormat(ManuscriptDeliveryFormatMaster ManuscriptDeliveryFormat)
 {
     _ManuscriptDeliveryFormatRepository.Update(ManuscriptDeliveryFormat);
 }
Exemple #6
0
 /// <summary>
 /// Methos to Fetch ManuscriptDeliveryFormatMaster Data
 /// </summary>
 /// <param name="ManuscriptDeliveryFormat">accepts ManuscriptDeliveryFormatMaster object as parameter</param>
 /// <returns>returns ManuscriptDeliveryFormatMaster object</returns>
 public ManuscriptDeliveryFormatMaster GetManuscriptDeliveryFormatById(ManuscriptDeliveryFormatMaster ManuscriptDeliveryFormat)
 {
     return(_ManuscriptDeliveryFormatRepository.Table.Where(i => i.Id == ManuscriptDeliveryFormat.Id).FirstOrDefault());
 }
Exemple #7
0
        /// <summary>
        /// Api method to get element by id
        /// </summary>
        /// <param name="mobjManuscriptDeliveryFormat">accepts ManuscriptDeliveryFormatMaster object as paramater </param>
        /// <returns></returns>
        public IHttpActionResult ManuscriptDeliveryFormat(ManuscriptDeliveryFormatMaster mobjManuscriptDeliveryFormat)
        {
            ManuscriptDeliveryFormatMaster _ManuscriptDeliveryFormat = _mobjManuscriptDeliveryFormatService.GetManuscriptDeliveryFormatById(mobjManuscriptDeliveryFormat);

            return(Json(_ManuscriptDeliveryFormat));
        }