Example #1
0
        // 得到所有的供应商
        public List <CommContracts.Supplier> GetAllSupplier(string strName = "")
        {
            CommClient.Supplier myd = new CommClient.Supplier();

            List <CommContracts.Supplier> list = new List <CommContracts.Supplier>();

            list = myd.GetAllSuppliers(strName);
            return(list);
        }
Example #2
0
        // 删除供应商
        public bool DeleteSupplier(int supplierID)
        {
            CommClient.Supplier myd = new CommClient.Supplier();
            if (myd.DeleteSupplier(supplierID))
            {
                return(true);
            }

            return(false);
        }
        public NewMaterialInStockView()
        {
            InitializeComponent();
            myTableEdit = new MyTableEdit(MyTableEditEnum.materialInStock);
            InStockPanel.Children.Add(myTableEdit);
            CommClient.Supplier supplier = new CommClient.Supplier();
            supplierList = supplier.GetAllSuppliers("");
            this.SupplierEdit.ItemsSource = supplierList;
            this.InStockWay.ItemsSource   = Enum.GetValues(typeof(CommContracts.InStoreEnum));

            this.Loaded += View_Loaded;
        }
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.NameEdit.Text.Trim()))
            {
                return;
            }

            if (bIsEdit)
            {
                Supplier.Name     = this.NameEdit.Text.Trim();
                Supplier.Contents = this.ContentsEdit.Text.Trim();
                Supplier.Tel      = this.TelEdit.Text.Trim();
                Supplier.Address  = this.AddressEdit.Text.Trim();

                CommClient.Supplier myd = new CommClient.Supplier();
                if (myd.UpdateSupplier(Supplier))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
            else
            {
                CommContracts.Supplier supplier = new CommContracts.Supplier();
                supplier.Name     = this.NameEdit.Text.Trim();
                supplier.Contents = this.ContentsEdit.Text.Trim();
                supplier.Tel      = this.TelEdit.Text.Trim();
                supplier.Address  = this.AddressEdit.Text.Trim();

                CommClient.Supplier myd = new CommClient.Supplier();
                if (myd.SaveSupplier(supplier))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
        }
Example #5
0
 // 得到所有供货商
 public List <CommContracts.Supplier> getAllSupplier()
 {
     CommClient.Supplier myd = new CommClient.Supplier();
     return(myd.GetAllSuppliers(""));
 }