本文整理汇总了C#中BaseService类的典型用法代码示例。如果您正苦于以下问题:C# BaseService类的具体用法?C# BaseService怎么用?C# BaseService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseService类属于命名空间,在下文中一共展示了BaseService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Post
public Eva_BonusSalaryModel Post([Bind]Eva_BonusSalaryModel model)
{
#region Validate
string message = string.Empty;
var checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData<Eva_BonusSalaryModel>(model, "Eva_BonusSalary", ref message);
if (!checkValidate)
{
model.ActionStatus = message;
return model;
}
#endregion
#region kt dữ liệu khi tính phòng ban, tháng hoặc quý
if (string.IsNullOrEmpty(model.Quarter) && string.IsNullOrEmpty(model.Month.ToString()))
{
message = string.Format(ConstantMessages.FieldNotAllowNull.TranslateString(), ("Quarter").TranslateString()) + " Or " + string.Format(ConstantMessages.FieldNotAllowNull.TranslateString(), ("Month").TranslateString());
model.ActionStatus = message;
return model;
}
#endregion
var service = new Eva_BonusSalaryServices();
var bService = new BaseService();
var bonusSalaryEntity = model.CopyData<Eva_BonusSalaryEntity>();
var m = service.CalculateBonusSalary(bonusSalaryEntity,UserLogin);
return m.CopyData<Eva_BonusSalaryModel>();
}
开发者ID:dtafe,项目名称:vnr,代码行数:28,代码来源:Eva_BonusSalaryController.cs
示例2: ActionBlackListCandidate
public string ActionBlackListCandidate(string selectedIds, Guid? _ReasonBlackListID)
{
using (var context = new VnrHrmDataContext())
{
BaseService service = new BaseService();
string message = string.Empty;
string status = string.Empty;
var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
var repoCandidate = new Rec_CandidateRepository(unitOfWork);
var repoHistory = new Rec_RecruitmentHistoryRepository(unitOfWork);
List<Guid> lstcandidateIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList();
var lstCandidates = repoCandidate.FindBy(m => m.ID != null && lstcandidateIds.Contains(m.ID)).ToList();
var lstRecruimentHistory = repoHistory.FindBy(m => m.CandidateID != null && lstcandidateIds.Contains(m.CandidateID)).ToList();
foreach (var Candidate in lstCandidates)
{
Candidate.IsBlackList = true;
Candidate.ReasonBlackListID = _ReasonBlackListID;
var hisbycandidate = lstRecruimentHistory.Where(s => s.CandidateID == Candidate.ID).OrderByDescending(s => s.DateApply).FirstOrDefault();
hisbycandidate.IsBlackList = true;
}
repoCandidate.SaveChanges();
repoHistory.SaveChanges();
message = NotificationType.Success.ToString();
return message;
}
}
开发者ID:dtafe,项目名称:vnr,代码行数:28,代码来源:Rec_CandidateServices.cs
示例3: GetById
public Rec_JobConditionModel GetById(Guid id)
{
string status = string.Empty;
var model = new Rec_JobConditionModel();
ActionService service = new ActionService(UserLogin);
var entity = service.GetByIdUseStore<Rec_JobConditionEntity>(id, ConstantSql.hrm_rec_sp_get_JobConditionById, ref status);//note
if (entity != null)
{
model = entity.CopyData<Rec_JobConditionModel>();
if (model.ConditionName == ConditionName.E_DISEASEIDS.ToString() && !string.IsNullOrEmpty(model.Value1))
{
var service1 = new BaseService();
var lst = service1.GetData<Cat_ComputingLevelMultiEntity>(model.Value1, ConstantSql.hrm_cat_sp_get_LevelGeneralByIds, UserLogin ,ref status).ToList();
var ids = model.Value1
.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => Common.OracleToDotNet(x.ToString()))
.ToList();
model.Value1 = string.Join(",", ids);
model.DiseaseIDs = string.Join(",", ids);
// model.ArrDisease = lst;
}
}
model.ActionStatus = status;
return model;
}
开发者ID:dtafe,项目名称:vnr,代码行数:29,代码来源:Rec_JobConditionController.cs
示例4: ConfirmarExclusao
public ActionResult ConfirmarExclusao(int id)
{
var servico = new BaseService<regional>();
servico.Excluir(ent => ent.regionalid == id);
servico.Salvar();
return RedirectToAction("Index");
}
开发者ID:allanjohny,项目名称:SGAL,代码行数:7,代码来源:RegionalController.cs
示例5: Get_LeaveDay_WillBeApproveByUser
public List<Att_LeaveDayEntity> Get_LeaveDay_WillBeApproveByUser(Guid UserLoginID, List<Att_LeaveDayEntity> lstLeavedayAfterFilter, string userLogin)
{
BaseService service = new BaseService();
string status = string.Empty;
List<object> lstParam = new List<object>();
lstParam.AddRange(new object[10]);
var lstDelegateApprove = service.GetData<Sys_DelegateApprove>(lstParam, ConstantSql.hrm_sys_sp_get_DelegateApprove, userLogin, ref status);
DateTime today = DateTime.Today;
string E_LEAVEDAY = DelegateApproveType.E_LEAVE_DAY.ToString();
List<Guid> lstUserCanView = lstDelegateApprove.Where(m => m.UserID != null
&& m.DataTypeDelegate == E_LEAVEDAY
&& m.DateFrom <= today
&& m.DateTo >= today
&& m.UserDelegateID == UserLoginID).Select(m => m.UserID.Value).ToList();
lstUserCanView.Add(UserLoginID);
string E_SUBMIT = LeaveDayStatus.E_SUBMIT.ToString();
string E_APPROVED = LeaveDayStatus.E_APPROVED.ToString();
string E_REJECTED = LeaveDayStatus.E_REJECTED.ToString();
string E_CANCEL = LeaveDayStatus.E_CANCEL.ToString();
var lstLeaveDay = lstLeavedayAfterFilter.Where(m =>
m.Status != E_APPROVED
&& m.Status != E_REJECTED
&& m.Status != E_CANCEL
&& ((m.Status == E_SUBMIT && m.UserApproveID != null && lstUserCanView.Contains(m.UserApproveID.Value))
|| (m.UserApproveID2 != null && lstUserCanView.Contains(m.UserApproveID2.Value)))).ToList();
return lstLeaveDay;
}
开发者ID:dtafe,项目名称:vnr,代码行数:31,代码来源:Att_ProcessApprovedServices.cs
示例6: Execute
public void Execute()
{
if (!string.IsNullOrWhiteSpace(JobArgs))
{
BaseService service = new BaseService();
string status = string.Empty;
var taskArgs = JobArgs.Split('|');
JobType = taskArgs.Length > 0 ? taskArgs[0] : string.Empty;
var procedure = taskArgs.Length > 1 ? taskArgs[1] : string.Empty;
var email = taskArgs.Length > 2 ? taskArgs[2] : string.Empty;
try
{
//Gọi lệnh thực thi câu stored procedure
service.ActionData(procedure,ref status);
}
catch (Exception ex)
{
//Gọi hàm gửi mail và throw exception để lớp dưới ghi log
//Sử dụng TaskName làm tiêu đề mail gửi đi + exception
SendMail(email, JobType, ex.GetExceptionMessage());
throw;
}
}
}
开发者ID:dtafe,项目名称:vnr,代码行数:25,代码来源:Sys_AutoBackupServices.cs
示例7: ActionApprovedCandidate
public string ActionApprovedCandidate(string selectedIds)
{
using (var context = new VnrHrmDataContext())
{
BaseService service = new BaseService();
string message = string.Empty;
string status = string.Empty;
var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
var repoCandidate = new Rec_CandidateRepository(unitOfWork);
var repoHistory = new Rec_RecruitmentHistoryRepository(unitOfWork);
List<Guid> lstcandidateIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList();
var lstCandidates = repoCandidate.FindBy(m => m.ID != null && lstcandidateIds.Contains(m.ID)).ToList();
var lstRecruimentHistory = repoHistory.FindBy(m => m.CandidateID != null && lstcandidateIds.Contains(m.CandidateID)).ToList();
foreach (var Candidate in lstCandidates)
{
Candidate.Status = HRM.Infrastructure.Utilities.EnumDropDown.CandidateStatus.E_APPROVE.ToString();
Candidate.DateUpdate = DateTime.Now;
var hisbycandidate = lstRecruimentHistory.Where(s => s.CandidateID == Candidate.ID).OrderByDescending(s => s.DateApply).FirstOrDefault();
hisbycandidate.Status = HRM.Infrastructure.Utilities.EnumDropDown.CandidateStatus.E_APPROVE.ToString();
hisbycandidate.CandidateID = Candidate.ID;
hisbycandidate.DateUpdate = DateTime.Now;
}
repoCandidate.SaveChanges();
repoHistory.SaveChanges();
message = NotificationType.Success.ToString();
return message;
}
}
开发者ID:dtafe,项目名称:vnr,代码行数:30,代码来源:Rec_CandidateServices.cs
示例8: DeleteItems
public JsonResult DeleteItems(string idList)
{
var flag = false;
var count = 0;
if (idList != null)
{
count = idList.Split(',').Count();
flag = new BaseService().Delete("Product", idList);
}
return Json(new { flag = flag, count = count });
}
开发者ID:sillyx,项目名称:EnterPriceWebsite,代码行数:11,代码来源:ProductController.cs
示例9: GetCatShiftItem
public List<Cat_ShiftItemEntity> GetCatShiftItem( string userLogin)
{
using (var context = new VnrHrmDataContext())
{
IUnitOfWork unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
Cat_ShiftItemRepository repo = new Cat_ShiftItemRepository(unitOfWork);
BaseService service = new BaseService();
string status = string.Empty;
return service.GetData<Cat_ShiftItemEntity>(ConstantSql.hrm_cat_sp_get_ShiftItem, string.Empty, userLogin, ref status);
}
}
开发者ID:dtafe,项目名称:vnr,代码行数:12,代码来源:Cat_ShiftItemServices.cs
示例10: Editar
public ActionResult Editar(int? id)
{
if (id == null)
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
regional regional = new BaseService<regional>().Obter(id.Value);
if (regional == null)
return HttpNotFound();
return View(regional);
}
开发者ID:allanjohny,项目名称:SGAL,代码行数:12,代码来源:RegionalController.cs
示例11: Edit
public JsonResult Edit(Solution solution)
{
var res = false;
if (solution.Id == null || solution.Id == Guid.Empty.ToSafeTrim())
{
solution.Id = Guid.NewGuid().ToSafeTrim();
res = new BaseService().Insert<Solution>(solution);
}
else
res = new BaseService().Update<Solution>(solution);
return Json(new { res = res });
}
开发者ID:sillyx,项目名称:EnterPriceWebsite,代码行数:12,代码来源:SolutionController.cs
示例12: Edit
public JsonResult Edit(AboutUs us)
{
var res = false;
if (us.Id == null || us.Id == Guid.Empty.ToSafeTrim())
{
us.Id = Guid.NewGuid().ToSafeTrim();
res = new BaseService().Insert<AboutUs>(us);
}
else
res = new BaseService().Update<AboutUs>(us);
return Json(new { res = res });
}
开发者ID:sillyx,项目名称:EnterPriceWebsite,代码行数:12,代码来源:AboutUsController.cs
示例13: Editar
public ActionResult Editar(int? id)
{
if (id == null)
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
adepto adepto = new BaseService<adepto>().Obter(id.Value);
if (adepto == null)
return HttpNotFound();
return View(adepto);
}
开发者ID:allanjohny,项目名称:SGAL,代码行数:12,代码来源:AdeptoController.cs
示例14: Editar
public ActionResult Editar(int? id)
{
if (id == null)
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
associacao associacao = new BaseService<associacao>().Obter(id.Value);
if (associacao == null)
return HttpNotFound();
CriarViewBags();
return View(associacao);
}
开发者ID:allanjohny,项目名称:SGAL,代码行数:13,代码来源:AssociacaoController.cs
示例15: Editar
public ActionResult Editar([Bind(Include = "federacaoid,datainclusao,descricao")] federacao federacao)
{
if (ModelState.IsValid)
{
//Campo atribuído automaticamente
federacao.dataalteracao = DateTime.Now;
var servico = new BaseService<federacao>();
servico.Alterar(federacao);
servico.Salvar();
return RedirectToAction("Index");
}
return View(federacao);
}
开发者ID:allanjohny,项目名称:SGAL,代码行数:13,代码来源:federacaoController.cs
示例16: Get
public IEnumerable<Eva_SalesTypeMultiModel> Get()
{
BaseService service = new BaseService();
string status = string.Empty;
var listEntity = service.GetDataNotParam<Eva_SalesTypeMultiModel>(ConstantSql.hrm_eva_sp_get_SalesType_multi,UserLogin, ref status);
if (listEntity != null)
{
var listModel = listEntity.Translate<Eva_SalesTypeMultiModel>();
return listModel;
}
return new List<Eva_SalesTypeMultiModel>();
}
开发者ID:dtafe,项目名称:vnr,代码行数:13,代码来源:Eva_SalesTypeController.cs
示例17: SetStatusSelected
public void SetStatusSelected(string selectedIds, string status)
{
if (!string.IsNullOrEmpty(selectedIds))
{
selectedIds = Common.DotNetToOracle(selectedIds);
BaseService service = new BaseService();
string statusMessages = string.Empty;
List<object> lstObj = new List<object>();
lstObj.Add(selectedIds);
lstObj.Add(status);
service.UpdateData<Att_LeaveDayModel>(lstObj, ConstantSql.hrm_att_sp_get_Leaveday_UpdateStatus, ref statusMessages);
}
}
开发者ID:dtafe,项目名称:vnr,代码行数:13,代码来源:Att_LeavedayController.cs
示例18: Post
public Sal_CostCentreSalModel Post([Bind]Sal_CostCentreSalModel model)
{
ActionService service = new ActionService(UserLogin);
#region Validate
string message = string.Empty;
var checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData<Sal_CostCentreSalModel>(model, "Sal_CostCentreSal", ref message);
if (!checkValidate)
{
model.ActionStatus = message;
return model;
}
#endregion
string status = string.Empty;
var baseService = new BaseService();
var objs = new List<object>();
objs.Add(Common.DotNetToOracle(model.ProfileID.ToString()));
objs.Add(1);
objs.Add(10000);
var result = baseService.GetData<Sal_CostCentreSalEntity>(objs, ConstantSql.hrm_hr_sp_get_Sal_CostCentreSalByProfileId, UserLogin, ref status);
//kiem tra he so cua 1 nv
if(model.ID == Guid.Empty)
{
double? rate = result.Sum(s => s.Rate);
double? ratenew = rate + model.Rate;
if (ratenew > 1)
{
model.SetPropertyValue(Constant.ActionStatus, NotificationType.Error + ",");
return model;
}
}
else
{
result = result.Where(s => s.ID != model.ID).ToList();
double? rate = result.Sum(s => s.Rate);
double? ratenew = rate + model.Rate;
if (ratenew > 1)
{
model.SetPropertyValue(Constant.ActionStatus, NotificationType.Error + ",");
return model;
}
}
//kiem tra trung
var resultdulicate = result.Where(s => s.CostCentreID == model.CostCentreID && s.ElementType == model.ElementType).ToList();
if (resultdulicate.Count > 0)
{
model.SetPropertyValue(Constant.ActionStatus, NotificationType.Info + "," + ConstantMessages.FieldDuplicate);
return model;
}
return service.UpdateOrCreate<Sal_CostCentreSalEntity, Sal_CostCentreSalModel>(model);
}
开发者ID:dtafe,项目名称:vnr,代码行数:51,代码来源:Sal_CostCentreSalController.cs
示例19: Get
/// <summary>
/// [Hien.Nguyen] Get All Cat_Shift for Multi Control
/// </summary>
/// <returns></returns>
public IEnumerable<CatLeaveDayTypeModel> Get()
{
BaseService service = new BaseService();
string status = string.Empty;
var listEntity = service.GetData<CatLeaveDayTypeModel>(string.Empty, ConstantSql.hrm_cat_sp_get_LeaveDayType_multi,UserLogin, ref status);
if (listEntity != null)
{
var listModel = listEntity.Translate<CatLeaveDayTypeModel>();
return listModel;
}
return new List<CatLeaveDayTypeModel>();
}
开发者ID:dtafe,项目名称:vnr,代码行数:18,代码来源:CatLeaveDayTypeController.cs
示例20: Get
//// GET api/<controller>
///// <summary>
///// Lấy tất cả dữ liệu
///// </summary>
///// <returns></returns>
public IEnumerable<Sys_UserMultiModel> Get()
{
BaseService service = new BaseService();
string status = string.Empty;
var listEntity = service.GetData<Sys_UserMultiModel>(string.Empty, ConstantSql.hrm_sys_sp_get_user_multi, UserLogin, ref status);
if (listEntity != null)
{
var listModel = listEntity.Translate<Sys_UserMultiModel>();
return listModel;
}
return new List<Sys_UserMultiModel>();
}
开发者ID:dtafe,项目名称:vnr,代码行数:19,代码来源:Sys_UserController.cs
注:本文中的BaseService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论