コード例 #1
0
        public bool Remove(FuelDeliveryObject fuelDelivery)
        {
            SqlCommand cmd = null;

            try
            {
                ExecuteNonQuery(out cmd, false, "FuelDelivery_DELETE",
                                CreateParameter("@fueldelID", SqlDbType.UniqueIdentifier, fuelDelivery.FuelDeliveryID, ParameterDirection.Input)
                                );
                return(true);
            }
            catch (Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            finally
            {
                if (cmd != null)
                {
                    cmd.Dispose();
                }
                cmd = null;
            }
        }
コード例 #2
0
        public void Save(FuelDeliveryObject fuelDelivery)
        {
            SqlCommand cmd = null;

            try
            {
                ExecuteNonQuery(out cmd, false, "FuelDelivery_SAVE",
                                CreateParameter("@fueldelID", SqlDbType.UniqueIdentifier, fuelDelivery.FuelDeliveryID, ParameterDirection.InputOutput),
                                CreateParameter("@supID", SqlDbType.UniqueIdentifier, fuelDelivery.Supplier.SupID),
                                CreateParameter("@DateDelivery", SqlDbType.VarChar, fuelDelivery.DateDelivery),
                                CreateParameter("@DateInvoice", SqlDbType.VarChar, fuelDelivery.DateInvoice),
                                CreateParameter("@Quantity", SqlDbType.Decimal, fuelDelivery.Quantity),
                                CreateParameter("@UnityPrice", SqlDbType.Decimal, fuelDelivery.UnityPrice),
                                CreateParameter("@Location", SqlDbType.Int, (int)fuelDelivery.Location),
                                CreateParameter("@Remark", SqlDbType.NVarChar, fuelDelivery.Remark)
                                );
                fuelDelivery.FuelDeliveryID = (Guid)cmd.Parameters["@fueldelID"].Value;
            }
            catch (Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            finally
            {
                if (cmd != null)
                {
                    cmd.Dispose();
                }
                cmd = null;
            }
        }
コード例 #3
0
        public static FuelDeliveryObject FuelDeliveryRowToObject(DataRow FuelDelivery)
        {
            FuelDeliveryObject obj = new FuelDeliveryObject();
            try
            {
                if (FuelDelivery != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(FuelDelivery, FuelDeliveryObject.FUELDEL_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.FuelDeliveryID = RowFunctions.GetValueFromRowToGuid(FuelDelivery, FuelDeliveryObject.FUELDEL_ID, true, DataRowVersion.Current);
                        obj.Supplier = SupplierConvertor.SupplierRowToObject(FuelDelivery);
                        obj.DateDelivery = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.DATE_DELIVERY, false, DataRowVersion.Current);
                        obj.DateInvoice = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.DATE_INVOICE, false, DataRowVersion.Current);
                        obj.Quantity = RowFunctions.GetValueFromRowToDecimal(FuelDelivery, FuelDeliveryObject.QUANTITY, false, DataRowVersion.Current);
                        obj.UnityPrice = RowFunctions.GetValueFromRowToDecimal(FuelDelivery, FuelDeliveryObject.UNITY_PRICE, false, DataRowVersion.Current);
                        obj.Location = (Framework.Common.Enumeration.Fuel.Location)RowFunctions.GetValueFromRowToInteger(FuelDelivery, FuelDeliveryObject.LOCATION, false, DataRowVersion.Current);
                        obj.Remark = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.REMARK, false, DataRowVersion.Current);

                    }
                    return obj;
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return obj;
        }
コード例 #4
0
        public static FuelDeliveryObject FuelDeliveryRowToObject(DataRow FuelDelivery)
        {
            FuelDeliveryObject obj = new FuelDeliveryObject();

            try
            {
                if (FuelDelivery != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(FuelDelivery, FuelDeliveryObject.FUELDEL_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.FuelDeliveryID = RowFunctions.GetValueFromRowToGuid(FuelDelivery, FuelDeliveryObject.FUELDEL_ID, true, DataRowVersion.Current);
                        obj.Supplier       = SupplierConvertor.SupplierRowToObject(FuelDelivery);
                        obj.DateDelivery   = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.DATE_DELIVERY, false, DataRowVersion.Current);
                        obj.DateInvoice    = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.DATE_INVOICE, false, DataRowVersion.Current);
                        obj.Quantity       = RowFunctions.GetValueFromRowToDecimal(FuelDelivery, FuelDeliveryObject.QUANTITY, false, DataRowVersion.Current);
                        obj.UnityPrice     = RowFunctions.GetValueFromRowToDecimal(FuelDelivery, FuelDeliveryObject.UNITY_PRICE, false, DataRowVersion.Current);
                        obj.Location       = (Framework.Common.Enumeration.Fuel.Location)RowFunctions.GetValueFromRowToInteger(FuelDelivery, FuelDeliveryObject.LOCATION, false, DataRowVersion.Current);
                        obj.Remark         = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.REMARK, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
コード例 #5
0
ファイル: FuelDelivery.cs プロジェクト: GianiWVL/VUYLSTEKE
 public void Save(FuelDeliveryObject fuelDelivery)
 {
     try
     {
         CheckTransaction();
         new FuelDeliveryDataService(Transaction).Save(fuelDelivery);
         if (IsOwner)
         {
             Transaction.Commit();
         }
     }
     catch (Exception exception1)
     {
         if (IsOwner)
         {
             Transaction.Rollback();
         }
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (IsOwner)
         {
             Connection.Close();
         }
     }
 }
コード例 #6
0
 public void Remove(FuelDeliveryObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #7
0
 public int Add(FuelDeliveryObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #8
0
 // Called by FuelDeliveryObject when it changes
 internal void FuelDeliveryObjectChanged(FuelDeliveryObject FuelDelivery)
 {
     try
     {
         int index = List.IndexOf(FuelDelivery);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #9
0
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         FuelDeliveryObject FuelDelivery = new FuelDeliveryObject();
         List.Add(FuelDelivery);
         return(FuelDelivery);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #10
0
 protected override void OnRemoveComplete(int index, object value)
 {
     try
     {
         FuelDeliveryObject FuelDelivery = (FuelDeliveryObject)value;
         FuelDelivery.Parent = this;
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #11
0
ファイル: FuelDelivery.cs プロジェクト: GianiWVL/VUYLSTEKE
 public void Remove(FuelDeliveryObject fuelDelivery)
 {
     try
     {
         CheckTransaction();
         new FuelDeliveryDataService(Transaction).Remove(fuelDelivery);
         if (IsOwner) Transaction.Commit();
     }
     catch (Exception exception1)
     {
         if (IsOwner) Transaction.Rollback();
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (IsOwner) Connection.Close();
     }
 }
コード例 #12
0
 private void gdvFuelDelivery_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         GridView view = (GridView)sender;
         FuelDeliveryObject fuelDelivery = (FuelDeliveryObject)view.GetRow(view.FocusedRowHandle);
         TIS.Client.Fuel.FuelDeliveryDetail fuelDeliveryDetail = new FuelDeliveryDetail(PROF_IT.Common.Enumerations.TypeForm.PropertyForm, fuelDelivery);
         if (fuelDeliveryDetail.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             this.FilterDelivery();
         }
     }
     catch (System.Exception excepion1)
     {
         Cursor.Current = Cursors.Default;
         System.Exception thisException = excepion1;
         Management.ShowException(thisException);
     }
 }
コード例 #13
0
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            try
            {
                if (oldValue != newValue)
                {
                    FuelDeliveryObject oldFuelDelivery = (FuelDeliveryObject)oldValue;
                    FuelDeliveryObject newFuelDelivery = (FuelDeliveryObject)newValue;
                    oldFuelDelivery.Parent = null;
                    newFuelDelivery.Parent = this;

                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
                }
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
コード例 #14
0
 public FuelDeliveryDetail(PROF_IT.Common.Enumerations.TypeForm typeForm)
 {
     try
     {
         InitializeComponent();
         _typeForm = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             FuelDeliveryMember = new FuelDeliveryObject();
             FindAll();
         }
         else
         {
             throw new NotImplementedException();
         }
         SetPermissions();
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #15
0
 public FuelDeliveryDetail(PROF_IT.Common.Enumerations.TypeForm typeForm)
 {
     try
     {
         InitializeComponent();
         _typeForm = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             FuelDeliveryMember = new FuelDeliveryObject();
             FindAll();
         }
         else
         {
             throw new NotImplementedException();
         }
         SetPermissions();
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #16
0
 // Called by FuelDeliveryObject when it changes
 internal void FuelDeliveryObjectChanged(FuelDeliveryObject FuelDelivery)
 {
     try
     {
         int index = List.IndexOf(FuelDelivery);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #17
0
 public void Remove(FuelDeliveryObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #18
0
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         FuelDeliveryObject FuelDelivery = new FuelDeliveryObject();
         List.Add(FuelDelivery);
         return FuelDelivery;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #19
0
 public void Save(FuelDeliveryObject fuelDelivery)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "FuelDelivery_SAVE",
             CreateParameter("@fueldelID", SqlDbType.UniqueIdentifier, fuelDelivery.FuelDeliveryID, ParameterDirection.InputOutput),
             CreateParameter("@supID", SqlDbType.UniqueIdentifier, fuelDelivery.Supplier.SupID),
             CreateParameter("@DateDelivery", SqlDbType.VarChar, fuelDelivery.DateDelivery),
             CreateParameter("@DateInvoice", SqlDbType.VarChar, fuelDelivery.DateInvoice),
             CreateParameter("@Quantity", SqlDbType.Decimal, fuelDelivery.Quantity),
             CreateParameter("@UnityPrice", SqlDbType.Decimal, fuelDelivery.UnityPrice),
             CreateParameter("@Location", SqlDbType.Int, (int)fuelDelivery.Location),
             CreateParameter("@Remark",SqlDbType.NVarChar, fuelDelivery.Remark)
             );
         fuelDelivery.FuelDeliveryID = (Guid)cmd.Parameters["@fueldelID"].Value;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }
コード例 #20
0
 public int Add(FuelDeliveryObject value)
 {
     try
     {
         return List.Add(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #21
0
 public bool Remove(FuelDeliveryObject fuelDelivery)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "FuelDelivery_DELETE",
             CreateParameter("@fueldelID", SqlDbType.UniqueIdentifier, fuelDelivery.FuelDeliveryID, ParameterDirection.Input)
             );
         return true;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }