예제 #1
0
파일: Suppliers.cs 프로젝트: mnisl/OD
		///<summary></summary>
		public static long Insert(Supplier supp) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				supp.SupplierNum=Meth.GetLong(MethodBase.GetCurrentMethod(),supp);
				return supp.SupplierNum;
			}
			return Crud.SupplierCrud.Insert(supp);
		}
예제 #2
0
파일: Suppliers.cs 프로젝트: mnisl/OD
		///<summary></summary>
		public static void Update(Supplier supp) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),supp);
				return;
			}
			Crud.SupplierCrud.Update(supp);
		}
예제 #3
0
		private void butAdd_Click(object sender,EventArgs e) {
			Supplier supp=new Supplier();
			supp.IsNew=true;
			FormSupplierEdit FormS=new FormSupplierEdit();
			FormS.Supp=supp;
			FormS.ShowDialog();
			if(FormS.DialogResult==DialogResult.OK) {
				FillGrid();
			}
		}
예제 #4
0
파일: Suppliers.cs 프로젝트: mnisl/OD
		///<summary>Surround with try-catch.</summary>
		public static void DeleteObject(Supplier supp){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),supp);
				return;
			}
			//validate that not already in use.
			string command="SELECT COUNT(*) FROM supplyorder WHERE SupplierNum="+POut.Long(supp.SupplierNum);
			int count=PIn.Int(Db.GetCount(command));
			if(count>0) {
				throw new ApplicationException(Lans.g("Supplies","Supplier is already in use on an order. Not allowed to delete."));
			}
			command="SELECT COUNT(*) FROM supply WHERE SupplierNum="+POut.Long(supp.SupplierNum);
			count=PIn.Int(Db.GetCount(command));
			if(count>0) {
				throw new ApplicationException(Lans.g("Supplies","Supplier is already in use on a supply. Not allowed to delete."));
			}
			Crud.SupplierCrud.Delete(supp.SupplierNum);
		}