public DXInfo.Models.NameCode GetNameCode(DXInfo.Models.NameCodeType ncType) { string type = ncType.ToString(); DXInfo.Models.NameCode nameCode = uow.NameCode.GetAll().Where(w => w.Type == type).FirstOrDefault(); return(nameCode); }
protected override void AfterSelectResult() { base.AfterSelectResult(); if (this.SelectedResult == null) { return; } if (this.Detail == null) { this.Detail = new CardAddPageDetail(); } dynamic c = this.SelectedResult;//CardList.SelectedItem; Guid id = c.Id; DXInfo.Models.Cards card = Uow.Cards.GetById(g => g.Id == id); var d = Uow.CardLevels.GetById(g => g.Id == card.CardLevel); if (d != null) { card.SecondCardNo = d.BeginLetter; } this.Detail.Card = card; DXInfo.Models.NameCode nc = Uow.NameCode.GetAll().Where(w => w.Type == "CostFee").FirstOrDefault(); if (nc != null) { this.Detail.Cost = Convert.ToDecimal(nc.Value); } }
public Service1(IFairiesMemberManageUow uow) { this.uow = uow; this.localDeptId = Guid.Empty; DXInfo.Models.NameCode nc = uow.NameCode.GetAll().Where(w => w.Type == "LocalDept").FirstOrDefault(); if (nc != null) { Guid.TryParse(nc.Value, out localDeptId); } Mapper.CreateMap <DXInfo.Models.OrderMenus, DXInfo.Models.OrderMenusHis>(); }
public ActionResult Para_EditData(DXInfo.Models.NameCode nc) { var gridModel = new ParaGridModel(); SetupParaGridModel(gridModel.ParasGrid); if (gridModel.ParasGrid.AjaxCallBackMode == AjaxCallBackMode.AddRow) { using (var context = db) { nc.ID = Guid.NewGuid(); if (nc.Type == "DeptCodeLength") { //DeptCodeLength var n = context.NameCode.Where(w => w.Type == "DeptCodeLength").FirstOrDefault(); if (n != null) { return(gridModel.ParasGrid.ShowEditValidationMessage("部门编码长度记录只能有一条")); } } context.NameCode.Add(nc); context.SaveChanges(); } } if (gridModel.ParasGrid.AjaxCallBackMode == AjaxCallBackMode.EditRow) { using (var context = db) { var oldnc = context.NameCode.Where(w => w.ID == nc.ID).FirstOrDefault(); oldnc.Code = nc.Code; oldnc.Name = nc.Name; oldnc.Value = nc.Value; oldnc.Comment = nc.Comment; context.SaveChanges(); } } return(RedirectToAction("Para")); }
private void Button_Click(object sender, RoutedEventArgs e) { if (cbLocalDept.SelectedItem != null) { var q = from n in uow.NameCode.GetAll() where n.Type == "LocalDept" select n; if (q.Count() == 0) { DXInfo.Models.Depts d = cbLocalDept.SelectedItem as DXInfo.Models.Depts; DXInfo.Models.NameCode nc = new DXInfo.Models.NameCode(); nc.Type = "LocalDept"; nc.Code = "001"; nc.Name = "本地部门"; nc.Value = d.DeptId.ToString(); nc.Comment = "启用于:" + DateTime.Now.ToString(); uow.NameCode.Add(nc); uow.Commit(); } } this.Close(); }