// 得到所有的其他服务项目 public List <CommContracts.OtherServiceItem> GetAllOtherServiceItem(string strName = "") { CommClient.OtherServiceItem myd = new CommClient.OtherServiceItem(); List <CommContracts.OtherServiceItem> list = new List <CommContracts.OtherServiceItem>(); list = myd.GetAllOtherServiceItem(strName); return(list); }
// 删除供其他服务项目 public bool DeleteOtherServiceItem(int OtherServiceItemID) { CommClient.OtherServiceItem myd = new CommClient.OtherServiceItem(); if (myd.DeleteOtherServiceItem(OtherServiceItemID)) { return(true); } return(false); }
private void SaveBtn_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(this.NameEdit.Text.Trim())) { return; } if (bIsEdit) { OtherServiceItem.Name = this.NameEdit.Text.Trim(); OtherServiceItem.AbbrPY = this.AbbrPY.Text; OtherServiceItem.AbbrWB = this.AbbrWB.Text; OtherServiceItem.Unit = this.Unit.Text; OtherServiceItem.Price = decimal.Parse(this.Price.Text); CommClient.OtherServiceItem myd = new CommClient.OtherServiceItem(); if (myd.UpdateOtherServiceItem(OtherServiceItem)) { (this.Parent as Window).DialogResult = true; (this.Parent as Window).Close(); } } else { CommContracts.OtherServiceItem OtherServiceItem = new CommContracts.OtherServiceItem(); OtherServiceItem.Name = this.NameEdit.Text.Trim(); OtherServiceItem.AbbrPY = this.AbbrPY.Text.Trim(); OtherServiceItem.AbbrWB = this.AbbrWB.Text.Trim(); OtherServiceItem.Unit = this.Unit.Text.Trim(); if (!string.IsNullOrEmpty(this.Price.Text)) { OtherServiceItem.Price = decimal.Parse(this.Price.Text.Trim()); } CommClient.OtherServiceItem myd = new CommClient.OtherServiceItem(); if (myd.SaveOtherServiceItem(OtherServiceItem)) { (this.Parent as Window).DialogResult = true; (this.Parent as Window).Close(); } } }
private void getAllData() { string strFindName = ""; // 暂时先搜索空 this.Grid1.ItemsSource = null; if (editEnum == MyTableEditEnum.xichengyao) { CommClient.Medicine myd = new CommClient.Medicine(); List <CommContracts.Medicine> list = myd.GetAllXiChengMedicine(strFindName); this.Grid1.ItemsSource = list; this.Grid1.Focus(); } else if (editEnum == MyTableEditEnum.zhongyao) { CommClient.Medicine myd = new CommClient.Medicine(); List <CommContracts.Medicine> list = myd.GetOneTypeMedicine(CommContracts.MedicineTypeEnum.中药, strFindName); this.Grid1.ItemsSource = list; this.Grid1.Focus(); } else if (editEnum == MyTableEditEnum.medicineInStock) { CommClient.Medicine myd = new CommClient.Medicine(); List <CommContracts.Medicine> list = myd.GetAllMedicine(strFindName); this.Grid1.ItemsSource = list; this.Grid1.Focus(); } else if (editEnum == MyTableEditEnum.zhiliao) { CommClient.TherapyItem therapyItem = new CommClient.TherapyItem(); List <CommContracts.TherapyItem> list = therapyItem.GetAllTherapyItem(strFindName); this.Grid1.ItemsSource = list; this.Grid1.Focus(); } else if (editEnum == MyTableEditEnum.jianyan) { CommClient.AssayItem therapyItem = new CommClient.AssayItem(); List <CommContracts.AssayItem> list = therapyItem.GetAllAssayItem(strFindName); this.Grid1.ItemsSource = list; this.Grid1.Focus(); } else if (editEnum == MyTableEditEnum.jiancha) { CommClient.InspectItem therapyItem = new CommClient.InspectItem(); List <CommContracts.InspectItem> list = therapyItem.GetAllInspectItem(strFindName); this.Grid1.ItemsSource = list; this.Grid1.Focus(); } else if (editEnum == MyTableEditEnum.cailiao || editEnum == MyTableEditEnum.materialInStock) { CommClient.MaterialItem therapyItem = new CommClient.MaterialItem(); List <CommContracts.MaterialItem> list = therapyItem.GetAllMaterialItem(strFindName); this.Grid1.ItemsSource = list; this.Grid1.Focus(); } else if (editEnum == MyTableEditEnum.qita) { CommClient.OtherServiceItem otherServiceItem = new CommClient.OtherServiceItem(); List <CommContracts.OtherServiceItem> list = otherServiceItem.GetAllOtherServiceItem(strFindName); this.Grid1.ItemsSource = list; this.Grid1.Focus(); } else if (editEnum == MyTableEditEnum.medicineOutStock) { CommClient.StoreRoomMedicineNum storeRoomMedicineNum = new CommClient.StoreRoomMedicineNum(); List <CommContracts.StoreRoomMedicineNum> list = storeRoomMedicineNum.getAllMedicineItemNum(1, "", 0, -1, true, true, false, false); this.Grid1.ItemsSource = list; this.Grid1.Focus(); } else if (editEnum == MyTableEditEnum.materialOutStock) { CommClient.StoreRoomMaterialNum storeRoomMaterialNum = new CommClient.StoreRoomMaterialNum(); List <CommContracts.StoreRoomMaterialNum> list = storeRoomMaterialNum.getAllMaterialItemNum(1, "", 0, -1, true, true, false, false); this.Grid1.ItemsSource = list; this.Grid1.Focus(); } }