Beispiel #1
0
/// <summary>
/// Update EnumDistric
/// </summary>
/// <param name="entity"></param>
/// <returns>Message</returns>
        public async Task <string> UpdateEnumDistric(EnumDistric entity)
        {
            try
            {
                var result = await new EnumDistricRepository(logger).Update(entity);
                return(result);
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                throw ex;
            }
        }
        public async Task <ActionResult> Edit(EnumDistric data)
        {
            string result = string.Empty;

            try
            {
                result = await repo.UpdateEnumDistric(data);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
        public async Task <JsonResult> Delete(string ids)
        {
            string result = string.Empty;

            string[]    IdList = ids.Split('~');
            EnumDistric vm     = new EnumDistric();

            try
            {
                result = await repo.IsDeleteEnumDistric(IdList, vm);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
/// <summary>
/// Delete EnumDistric
/// </summary>
/// <param name="Id"></param>
/// <returns>Message</returns>
        public async Task <string> IsDeleteEnumDistric(string[] IdList, EnumDistric entity)
        {
            string result = string.Empty;

            try
            {
                for (int i = 0; i < IdList.Length - 1; i++)
                {
                    result = await new EnumDistricRepository(logger).IsDelete(Convert.ToInt32(IdList[i]), entity);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                throw ex;
            }
            return(result);
        }