public static async Task <员工> CheckUser(string result) { using (WebAPI webAPI = new WebAPI()) { var response = await webAPI.GetWebAPIAsync(Constants.RTSWebAPIEndpoint + "Labor?id=" + result); try { var employee = JsonConvert.DeserializeObject <员工>(response); if (employee != null) { Constants.User = employee; Constants.IsCheckedUser = true; } else { IsCheckedUser = false; } return(employee); } catch (Exception ex) { throw ex; } } }
protected override void OnChanged(string propertyName, object oldValue, object newValue) { base.OnChanged(propertyName, oldValue, newValue); if (!IsLoading) { if (propertyName == "供应商") { 供应商联系人 = 供应商.默认联系人; 发货地址 = 供应商.默认地址; } if (propertyName == "客户") { 客户联系人 = 客户.默认联系人; 收货地址 = 客户.默认地址; } if (propertyName == "业务员") { this.部门 = this.业务员?.部门; } if (propertyName == "税率") { var v = newValue == null ? 0 : 税率.税率; foreach (XPBaseObject item in 明细项目) { item.SetMemberValue("税率", v); } } } }
public IHttpActionResult Get员工(Guid id) { 员工 员工 = ddc.员工s.Single <员工>(x => x.Id == id && x.除 == false); //员工 员工 = db.员工.Find(id); //员工 员工 = new 员工(); //员工.Id = new Guid(); //员工.姓名 = "Test"; if (员工 == null) { return(NotFound()); } return(Ok(员工)); }
private void btnStaffAdd_Click(object sender, EventArgs e) { using (TransactionScope scope = new TransactionScope()) { 员工 temp = new 员工(); temp.Id = Guid.NewGuid(); temp.姓名 = tbName.Text; temp.班别 = new Guid(cbClassType.SelectedValue.ToString()); temp.登记时间 = DateTime.Now; ddc.员工s.InsertOnSubmit(temp); ddc.SubmitChanges(); scope.Complete(); } LoadData(); }
/// <summary> /// Remove an existing 员工 from the collection /// </summary> /// <pdGenerated>Default Remove</pdGenerated> public void Remove员工(员工 old员工) { if (old员工 == null) return; if (this.员工 != null) if (this.员工.Contains(old员工)) this.员工.Remove(old员工); }
/// <summary> /// Add a new 员工 in the collection /// </summary> /// <pdGenerated>Default Add</pdGenerated> public void Add员工(员工 new员工) { if (new员工 == null) return; if (this.员工 == null) this.员工 = new System.Collections.Generic.List<员工>(); if (!this.员工.Contains(new员工)) this.员工.Add(new员工); }