public static ACC_Account GetACC_SubBasicAccountBySubBasicAccountID(int SubBasicAccountID) { ACC_Account aCC_Account = new ACC_Account(); SqlACC_AccountProvider sqlACC_AccountProvider = new SqlACC_AccountProvider(); aCC_Account = sqlACC_AccountProvider.GetACC_AccountBySubBasicAccountID(SubBasicAccountID); return aCC_Account; }
protected void btnUpdate_Click(object sender, EventArgs e) { try { ACC_Account aCC_Account = new ACC_Account(); aCC_Account.AccountID = int.Parse(Request.QueryString["ID"].ToString()); aCC_Account.AccountName = txtAccountName.Text; aCC_Account.Description = txtDescription.Text; aCC_Account.SubBasicAccountID = int.Parse(ddlSubBasicAccountID.SelectedValue); aCC_Account.AccountCode = ""; aCC_Account.AddedBy = Profile.card_id; aCC_Account.AddedDate = DateTime.Now; aCC_Account.UpdatedBy = Profile.card_id; aCC_Account.UpdateDate = DateTime.Now; aCC_Account.RowStatusID = 1; bool resutl = ACC_AccountManager.UpdateACC_Account(aCC_Account); Response.Redirect("AdminDisplayACC_Account.aspx"); } catch (Exception ex) { } }
public static bool UpdateACC_Account(ACC_Account aCC_Account) { SqlACC_AccountProvider sqlACC_AccountProvider = new SqlACC_AccountProvider(); return sqlACC_AccountProvider.UpdateACC_Account(aCC_Account); }
public static int InsertACC_Account(ACC_Account aCC_Account) { SqlACC_AccountProvider sqlACC_AccountProvider = new SqlACC_AccountProvider(); return sqlACC_AccountProvider.InsertACC_Account(aCC_Account); }
public static ACC_Account GetCOMN_RowStatusByRowStatusID(int RowStatusID) { ACC_Account aCC_Account = new ACC_Account(); SqlACC_AccountProvider sqlACC_AccountProvider = new SqlACC_AccountProvider(); aCC_Account = sqlACC_AccountProvider.GetACC_AccountByRowStatusID(RowStatusID); return aCC_Account; }
private void showACC_AccountData() { ACC_Account aCC_Account = new ACC_Account (); aCC_Account = ACC_AccountManager.GetACC_AccountByAccountID(Int32.Parse(Request.QueryString["ID"])); txtAccountName.Text =aCC_Account.AccountName.ToString(); txtDescription.Text =aCC_Account.Description.ToString(); ddlSubBasicAccountID.SelectedValue =aCC_Account.SubBasicAccountID.ToString(); ddlBasicAccountID.SelectedValue = aCC_Account.BasicAccountID.ToString(); }
public bool UpdateACC_Account(ACC_Account aCC_Account) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("UpdateACC_Account", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@AccountID", SqlDbType.Int).Value = aCC_Account.AccountID; cmd.Parameters.Add("@AccountName", SqlDbType.NVarChar).Value = aCC_Account.AccountName; cmd.Parameters.Add("@Description", SqlDbType.NText).Value = aCC_Account.Description; cmd.Parameters.Add("@SubBasicAccountID", SqlDbType.Int).Value = aCC_Account.SubBasicAccountID; cmd.Parameters.Add("@AccountCode", SqlDbType.NVarChar).Value = aCC_Account.AccountCode; cmd.Parameters.Add("@AddedBy", SqlDbType.NVarChar).Value = aCC_Account.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = aCC_Account.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = aCC_Account.UpdatedBy; cmd.Parameters.Add("@UpdateDate", SqlDbType.DateTime).Value = aCC_Account.UpdateDate; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = aCC_Account.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public ACC_Account GetACC_AccountFromReader1(IDataReader reader) { try { ACC_Account aCC_Account = new ACC_Account ( DataAccessObject.IsNULL<int>(reader["AccountID"]) ); return aCC_Account; } catch (Exception ex) { return null; } }
public ACC_Account GetACC_AccountFromReader(IDataReader reader) { try { ACC_Account aCC_Account = new ACC_Account ( DataAccessObject.IsNULL<int>(reader["AccountID"]), DataAccessObject.IsNULL<string>(reader["AccountName"]), DataAccessObject.IsNULL<string>(reader["Description"]), DataAccessObject.IsNULL<int>(reader["SubBasicAccountID"]), DataAccessObject.IsNULL<string>(reader["AccountCode"]), DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]), DataAccessObject.IsNULL<string>(reader["UpdatedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["UpdateDate"]), DataAccessObject.IsNULL<int>(reader["RowStatusID"]) ); try { aCC_Account.BasicAccountID = DataAccessObject.IsNULL<int>(reader["BasicAccountID"]); } catch (Exception ex) { } return aCC_Account; } catch(Exception ex) { return null; } }