Procházet zdrojové kódy

合同类别 编号名字重复

新疆影视学院高职
ndbs před 2 roky
rodič
revize
0b0945df7f
4 změnil soubory, kde provedl 137 přidání a 9 odebrání
  1. +31
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ContractCategoryController.cs
  2. +48
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ContractCategory/ContractCategoryBLL.cs
  3. +8
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ContractCategory/ContractCategoryIBLL.cs
  4. +50
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ContractCategory/ContractCategoryService.cs

+ 31
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ContractCategoryController.cs Zobrazit soubor

@@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
[HttpGet] [HttpGet]
public ActionResult Index() public ActionResult Index()
{ {
return View();
return View();
} }
/// <summary> /// <summary>
/// 表单页 /// 表单页
@@ -35,7 +35,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
[HttpGet] [HttpGet]
public ActionResult Form() public ActionResult Form()
{ {
return View();
return View();
} }
#endregion #endregion


@@ -69,8 +69,9 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
[AjaxOnly] [AjaxOnly]
public ActionResult GetFormData(string keyValue) public ActionResult GetFormData(string keyValue)
{ {
var ContractCategoryData = contractCategoryIBLL.GetContractCategoryEntity( keyValue );
var jsonData = new {
var ContractCategoryData = contractCategoryIBLL.GetContractCategoryEntity(keyValue);
var jsonData = new
{
ContractCategory = ContractCategoryData, ContractCategory = ContractCategoryData,
}; };
return Success(jsonData); return Success(jsonData);
@@ -102,7 +103,32 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
public ActionResult SaveForm(string keyValue, string strEntity) public ActionResult SaveForm(string keyValue, string strEntity)
{ {
ContractCategoryEntity entity = strEntity.ToObject<ContractCategoryEntity>(); ContractCategoryEntity entity = strEntity.ToObject<ContractCategoryEntity>();
contractCategoryIBLL.SaveEntity(keyValue,entity);
var NoModel = contractCategoryIBLL.GetNoEntity(entity.Code);
var NameModel = contractCategoryIBLL.GetNameEntity(entity.Name);

if (string.IsNullOrEmpty(keyValue))
{
if (NoModel != null)
{
return Fail("类别编号已存在!");
}
if (NameModel != null)
{
return Fail("类别名称已存在!");
}
}
else
{
if (NoModel != null && NoModel.Id != keyValue)
{
return Fail("类别编号已存在!");
}
if (NameModel != null && NameModel.Id != keyValue)
{
return Fail("类别名称已存在!");
}
}
contractCategoryIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!"); return Success("保存成功!");
} }
#endregion #endregion


+ 48
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ContractCategory/ContractCategoryBLL.cs Zobrazit soubor

@@ -118,6 +118,54 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
} }
} }


/// <summary>
/// 去重
/// </summary>
/// <param name="No"></param>
/// <param name="Name"></param>
/// <returns></returns>
public ContractCategoryEntity GetNoEntity(string No)
{
try
{
return contractCategoryService.GetNoEntity(No);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
/// <summary>
/// 去重
/// </summary>
/// <param name="No"></param>
/// <param name="Name"></param>
/// <returns></returns>
public ContractCategoryEntity GetNameEntity(string Name)
{
try
{
return contractCategoryService.GetNameEntity(Name);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion #endregion


} }


+ 8
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ContractCategory/ContractCategoryIBLL.cs Zobrazit soubor

@@ -44,6 +44,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// <returns></returns> /// <returns></returns>
void SaveEntity(string keyValue, ContractCategoryEntity entity); void SaveEntity(string keyValue, ContractCategoryEntity entity);
#endregion #endregion

/// <summary>
/// 去重
/// </summary>
/// <param name="No"></param>
/// <param name="Name"></param>
/// <returns></returns>
ContractCategoryEntity GetNoEntity(string No);
ContractCategoryEntity GetNameEntity(string Name);
} }
} }

+ 50
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ContractCategory/ContractCategoryService.cs Zobrazit soubor

@@ -45,7 +45,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String);
strSql.Append(" AND t.Name Like @Name "); strSql.Append(" AND t.Name Like @Name ");
} }
return this.BaseRepository("CollegeMIS").FindList<ContractCategoryEntity>(strSql.ToString(),dp, pagination);
return this.BaseRepository("CollegeMIS").FindList<ContractCategoryEntity>(strSql.ToString(), dp, pagination);
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -97,7 +97,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
{ {
try try
{ {
this.BaseRepository("CollegeMIS").Delete<ContractCategoryEntity>(t=>t.Id == keyValue);
this.BaseRepository("CollegeMIS").Delete<ContractCategoryEntity>(t => t.Id == keyValue);
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -144,7 +144,54 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
} }
} }
} }

/// <summary>
/// 去重
/// </summary>
/// <param name="No"></param>
/// <param name="Name"></param>
/// <returns></returns>
public ContractCategoryEntity GetNoEntity(string No)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<ContractCategoryEntity>(t => t.Code == No);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
/// <summary>
/// 去重
/// </summary>
/// <param name="No"></param>
/// <param name="Name"></param>
/// <returns></returns>
public ContractCategoryEntity GetNameEntity(string Name)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<ContractCategoryEntity>(t => t.Name == Name);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion #endregion


} }


Načítá se…
Zrušit
Uložit