Beispiel #1
0
        /// <summary>
        /// Private methods
        /// </summary>
        /// <param name="userID"></param>
        ///
        private void InitiateEntity(int userID)
        {
            ADUserPrimaryKey pk = new ADUserPrimaryKey();

            pk.UserID = userID;
            ADUser _aDUser = _aDUserWrapper.SelectOne(pk);

            tbx_UserFullName.Text   = _aDUser.UserFullName;
            tbx_Address.Text        = _aDUser.Address;
            tbx_Email.Text          = _aDUser.Email;
            tbx_Mobile.Text         = _aDUser.Mobile;
            tbx_Phone.Text          = _aDUser.Phone;
            tbx_UserName.Text       = _aDUser.UserName;
            tbx_Password.Text       = _aDUser.Password;
            cbx_Group.SelectedValue = _aDUser.GroupID;
        }
Beispiel #2
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="ADUserPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class ADUser</returns>
		public ADUser SelectOne(ADUserPrimaryKey pk)
		{
			_aDUserWCF = new ADUser();
			_aDUser = POS.DataLayer.ADUserBase.SelectOne(new POS.DataLayer.ADUserPrimaryKey(pk.UserID));
			
				_aDUserWCF.UserID = _aDUser.UserID;
				_aDUserWCF.UserFullName = _aDUser.UserFullName;
				_aDUserWCF.UserName = _aDUser.UserName;
				_aDUserWCF.Password = _aDUser.Password;
				_aDUserWCF.GroupID = _aDUser.GroupID;
				_aDUserWCF.Email = _aDUser.Email;
				_aDUserWCF.Address = _aDUser.Address;
				_aDUserWCF.Phone = _aDUser.Phone;
				_aDUserWCF.Mobile = _aDUser.Mobile;
				
			return _aDUserWCF;
		}
Beispiel #3
0
 public override void btn_Delete_Click(object sender, EventArgs e)
 {
     if (dgrid_Result.SelectedRows.Count != 0)
     {
         ADUserPrimaryKey pk = new ADUserPrimaryKey();
         pk.UserID = Convert.ToInt32(dgrid_Result.SelectedRows[0].Cells["UserID"].Value);
         if (aDUserWrapper.Delete(pk))
         {
             MessageBox.Show("تم الحذف");
             BindGrid();
         }
     }
     else
     {
         MessageBox.Show("اختر عنصر اولا");
     }
 }
		/// <summary>
		/// This method will get row(s) from the database using the value of the field specified 
		/// along with the details of the child table.
		/// </summary>
		///
		/// <param name="pk" type="ADUserPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		/// <param name="pageSize" type="int">Number of records returned.</param>
		/// <param name="skipPages" type="int">The number of missing pages.</param>
		/// <param name="orderByStatement" type="string">The field value to number.</param>
		///
		/// <returns>object of class BDSupplierAccountCollection</returns>
		public BDSupplierAccountCollection SelectAllByForeignKeyCreatedByPaged(ADUserPrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
		{
			BDSupplierAccountCollection bDSupplierAccountCollection=new BDSupplierAccountCollection();
			foreach (POS.DataLayer.BDSupplierAccount _bDSupplierAccount in POS.DataLayer.BDSupplierAccountBase.SelectAllByForeignKeyCreatedByPaged(new POS.DataLayer.ADUserPrimaryKey(pk.UserID), pageSize, skipPages, orderByStatement))
			{
				_bDSupplierAccountWCF = new BDSupplierAccount();
				_bDSupplierAccountWCF.SupplierAccountId = _bDSupplierAccount.SupplierAccountId;
				_bDSupplierAccountWCF.PurcaseInvoiceID = _bDSupplierAccount.PurcaseInvoiceID;
				_bDSupplierAccountWCF.PurchaseDate = _bDSupplierAccount.PurchaseDate;
				_bDSupplierAccountWCF.SupplierID = _bDSupplierAccount.SupplierID;
				_bDSupplierAccountWCF.InvoiceNumber = _bDSupplierAccount.InvoiceNumber;
				_bDSupplierAccountWCF.TotalPrice = _bDSupplierAccount.TotalPrice;
				_bDSupplierAccountWCF.PaidAmount = _bDSupplierAccount.PaidAmount;
				_bDSupplierAccountWCF.IsVoid = _bDSupplierAccount.IsVoid;
				_bDSupplierAccountWCF.RemainingAmount = _bDSupplierAccount.RemainingAmount;
				_bDSupplierAccountWCF.CreateDate = _bDSupplierAccount.CreateDate;
				_bDSupplierAccountWCF.CreatedBy = _bDSupplierAccount.CreatedBy;
				_bDSupplierAccountWCF.updateDate = _bDSupplierAccount.updateDate;
				_bDSupplierAccountWCF.UpdatedBy = _bDSupplierAccount.UpdatedBy;
				_bDSupplierAccountWCF.IsDeleted = _bDSupplierAccount.IsDeleted;
				_bDSupplierAccountWCF.DeleteDate = _bDSupplierAccount.DeleteDate;
				_bDSupplierAccountWCF.DeletedBy = _bDSupplierAccount.DeletedBy;
				_bDSupplierAccountWCF.Depit = _bDSupplierAccount.Depit;
				_bDSupplierAccountWCF.Credit = _bDSupplierAccount.Credit;
				_bDSupplierAccountWCF.LstDayToPay = _bDSupplierAccount.LstDayToPay;
				_bDSupplierAccountWCF.ChequeNumber = _bDSupplierAccount.ChequeNumber;
				_bDSupplierAccountWCF.InvoiceType = _bDSupplierAccount.InvoiceType;
				
				bDSupplierAccountCollection.Add(_bDSupplierAccountWCF);
			}
			return bDSupplierAccountCollection;
		}
		/// <summary>
		/// This method will delete row(s) from the database using the value of the field specified 
		/// along with the details of the child table.
		/// </summary>
		///
		/// <param name="pk" type="ADUserPrimaryKey">Primary Key information based on which data is to be deleted.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool DeleteAllByForeignKeyCreatedBy(ADUserPrimaryKey pk)
		{
			return POS.DataLayer.BDSupplierAccountBase.DeleteAllByForeignKeyCreatedBy(new POS.DataLayer.ADUserPrimaryKey(pk.UserID));
		}
		/// <summary>
		/// This method will get row(s) from the database using the value of the field specified 
		/// along with the details of the child table.
		/// </summary>
		///
		/// <param name="pk" type="ADUserPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		/// <param name="pageSize" type="int">Number of records returned.</param>
		/// <param name="skipPages" type="int">The number of missing pages.</param>
		/// <param name="orderByStatement" type="string">The field value to number.</param>
		///
		/// <returns>object of class SALSalesHeaderCollection</returns>
		public SALSalesHeaderCollection SelectAllByForeignKeySellerIDPaged(ADUserPrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
		{
			SALSalesHeaderCollection sALSalesHeaderCollection=new SALSalesHeaderCollection();
			foreach (POS.DataLayer.SALSalesHeader _sALSalesHeader in POS.DataLayer.SALSalesHeaderBase.SelectAllByForeignKeySellerIDPaged(new POS.DataLayer.ADUserPrimaryKey(pk.UserID), pageSize, skipPages, orderByStatement))
			{
				_sALSalesHeaderWCF = new SALSalesHeader();
				_sALSalesHeaderWCF.SalesHeaderID = _sALSalesHeader.SalesHeaderID;
				_sALSalesHeaderWCF.SalesDate = _sALSalesHeader.SalesDate;
				_sALSalesHeaderWCF.CustomerID = _sALSalesHeader.CustomerID;
				_sALSalesHeaderWCF.InvoiceNumber = _sALSalesHeader.InvoiceNumber;
				_sALSalesHeaderWCF.InvoiceDate = _sALSalesHeader.InvoiceDate;
				_sALSalesHeaderWCF.SellerID = _sALSalesHeader.SellerID;
				_sALSalesHeaderWCF.PaymentTypeID = _sALSalesHeader.PaymentTypeID;
				_sALSalesHeaderWCF.TotalPrice = _sALSalesHeader.TotalPrice;
				_sALSalesHeaderWCF.PaidAmount = _sALSalesHeader.PaidAmount;
				_sALSalesHeaderWCF.RemainingAmount = _sALSalesHeader.RemainingAmount;
				_sALSalesHeaderWCF.LastDayToPay = _sALSalesHeader.LastDayToPay;
				_sALSalesHeaderWCF.TotalDiscountAmount = _sALSalesHeader.TotalDiscountAmount;
				_sALSalesHeaderWCF.TotalDiscountRatio = _sALSalesHeader.TotalDiscountRatio;
				_sALSalesHeaderWCF.IsClosed = _sALSalesHeader.IsClosed;
				_sALSalesHeaderWCF.IsVoid = _sALSalesHeader.IsVoid;
				_sALSalesHeaderWCF.IsPrinted = _sALSalesHeader.IsPrinted;
				_sALSalesHeaderWCF.ServicePrice = _sALSalesHeader.ServicePrice;
				_sALSalesHeaderWCF.TaxTypeID = _sALSalesHeader.TaxTypeID;
				_sALSalesHeaderWCF.RefuseReasonID = _sALSalesHeader.RefuseReasonID;
				_sALSalesHeaderWCF.CreatedBy = _sALSalesHeader.CreatedBy;
				_sALSalesHeaderWCF.CreateDate = _sALSalesHeader.CreateDate;
				_sALSalesHeaderWCF.UpdatedBy = _sALSalesHeader.UpdatedBy;
				_sALSalesHeaderWCF.UpdateDate = _sALSalesHeader.UpdateDate;
				_sALSalesHeaderWCF.IsDeleted = _sALSalesHeader.IsDeleted;
				_sALSalesHeaderWCF.DeletedBy = _sALSalesHeader.DeletedBy;
				_sALSalesHeaderWCF.DeletDate = _sALSalesHeader.DeletDate;
				_sALSalesHeaderWCF.InventoryID = _sALSalesHeader.InventoryID;
				_sALSalesHeaderWCF.FinalPrice = _sALSalesHeader.FinalPrice;
				_sALSalesHeaderWCF.ChequeNumber = _sALSalesHeader.ChequeNumber;
				
				sALSalesHeaderCollection.Add(_sALSalesHeaderWCF);
			}
			return sALSalesHeaderCollection;
		}
		/// <summary>
		/// This method will delete row(s) from the database using the value of the field specified 
		/// along with the details of the child table.
		/// </summary>
		///
		/// <param name="pk" type="ADUserPrimaryKey">Primary Key information based on which data is to be deleted.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool DeleteAllByForeignKeySellerID(ADUserPrimaryKey pk)
		{
			return POS.DataLayer.SALSalesHeaderBase.DeleteAllByForeignKeySellerID(new POS.DataLayer.ADUserPrimaryKey(pk.UserID));
		}
Beispiel #8
0
		///<summary>
		///This method will Delete the object from the database
		///</summary>
		///<param name="pk" type="ADUserPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		/// <returns>True if succeeded</returns>
		public bool Delete(ADUserPrimaryKey pk)
		{
			return POS.DataLayer.ADUserBase.Delete(new POS.DataLayer.ADUserPrimaryKey(pk.UserID));
		}
		/// <summary>
		/// This method will get row(s) from the database using the value of the field specified 
		/// along with the details of the child table.
		/// </summary>
		///
		/// <param name="pk" type="ADUserPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class BDCustomerAccountCollection</returns>
		public BDCustomerAccountCollection SelectAllByForeignKeyCreatedBy(ADUserPrimaryKey pk)
		{
			BDCustomerAccountCollection bDCustomerAccountCollection=new BDCustomerAccountCollection();
			foreach (POS.DataLayer.BDCustomerAccount _bDCustomerAccount in POS.DataLayer.BDCustomerAccountBase.SelectAllByForeignKeyCreatedBy(new POS.DataLayer.ADUserPrimaryKey(pk.UserID)))
			{
				_bDCustomerAccountWCF = new BDCustomerAccount();
				_bDCustomerAccountWCF.CustomerAccountNumber = _bDCustomerAccount.CustomerAccountNumber;
				_bDCustomerAccountWCF.CustomerID = _bDCustomerAccount.CustomerID;
				_bDCustomerAccountWCF.SalesInvoiceId = _bDCustomerAccount.SalesInvoiceId;
				_bDCustomerAccountWCF.SalesDate = _bDCustomerAccount.SalesDate;
				_bDCustomerAccountWCF.InvoiceNumber = _bDCustomerAccount.InvoiceNumber;
				_bDCustomerAccountWCF.TotalPrice = _bDCustomerAccount.TotalPrice;
				_bDCustomerAccountWCF.PaidAmount = _bDCustomerAccount.PaidAmount;
				_bDCustomerAccountWCF.RemainingAmount = _bDCustomerAccount.RemainingAmount;
				_bDCustomerAccountWCF.IsVoid = _bDCustomerAccount.IsVoid;
				_bDCustomerAccountWCF.CreatedBy = _bDCustomerAccount.CreatedBy;
				_bDCustomerAccountWCF.CreateDate = _bDCustomerAccount.CreateDate;
				_bDCustomerAccountWCF.UpdatedBy = _bDCustomerAccount.UpdatedBy;
				_bDCustomerAccountWCF.UpdateDate = _bDCustomerAccount.UpdateDate;
				_bDCustomerAccountWCF.IsDeleted = _bDCustomerAccount.IsDeleted;
				_bDCustomerAccountWCF.DeletedBy = _bDCustomerAccount.DeletedBy;
				_bDCustomerAccountWCF.DeletedDate = _bDCustomerAccount.DeletedDate;
				_bDCustomerAccountWCF.Depit = _bDCustomerAccount.Depit;
				_bDCustomerAccountWCF.Credit = _bDCustomerAccount.Credit;
				_bDCustomerAccountWCF.ChequeNumber = _bDCustomerAccount.ChequeNumber;
				_bDCustomerAccountWCF.InvoiceType = _bDCustomerAccount.InvoiceType;
				_bDCustomerAccountWCF.LstDayToPay = _bDCustomerAccount.LstDayToPay;
				
				bDCustomerAccountCollection.Add(_bDCustomerAccountWCF);
			}
			return bDCustomerAccountCollection;
		}