/// <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 BDCustomerAccountCollection</returns> public BDCustomerAccountCollection SelectAllByForeignKeyCreatedByPaged(ADUserPrimaryKey pk, int pageSize, int skipPages, string orderByStatement) { BDCustomerAccountCollection bDCustomerAccountCollection = new BDCustomerAccountCollection(); foreach (POS.DataLayer.BDCustomerAccount _bDCustomerAccount in POS.DataLayer.BDCustomerAccountBase.SelectAllByForeignKeyCreatedByPaged(new POS.DataLayer.ADUserPrimaryKey(pk.UserID), pageSize, skipPages, orderByStatement)) { _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.InvoiceType = _bDCustomerAccount.InvoiceType; bDCustomerAccountCollection.Add(_bDCustomerAccountWCF); } return(bDCustomerAccountCollection); }
/// <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); }
/// <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 BDSupplierAccountCollection</returns> public BDSupplierAccountCollection SelectAllByForeignKeyCreatedBy(ADUserPrimaryKey pk) { BDSupplierAccountCollection bDSupplierAccountCollection = new BDSupplierAccountCollection(); foreach (POS.DataLayer.BDSupplierAccount _bDSupplierAccount in POS.DataLayer.BDSupplierAccountBase.SelectAllByForeignKeyCreatedBy(new POS.DataLayer.ADUserPrimaryKey(pk.UserID))) { _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.InvoiceType = _bDSupplierAccount.InvoiceType; bDSupplierAccountCollection.Add(_bDSupplierAccountWCF); } return(bDSupplierAccountCollection); }
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 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); }
///<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 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.BDCustomerAccountBase.DeleteAllByForeignKeyCreatedBy(new POS.DataLayer.ADUserPrimaryKey(pk.UserID))); }
/// <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; }