public int DeleteSubGroupAccount(SubGroupAccountEntity oSubGroupAccountEntity) { con = oConnectionDatabase.DatabaseConnection(); int i = 0; cmd = new SqlCommand("DELETE FROM tblSubGroupAccount WHERE SGrpAccSL=" + oSubGroupAccountEntity.SGrpAccSL, con); try { cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); i = 1; } catch { } con.Close(); return(i); }
public int UpdateSubGroupAccount(SubGroupAccountEntity oSubGroupAccountEntity) { con = oConnectionDatabase.DatabaseConnection(); int i = 0; cmd = new SqlCommand("UPDATE tblSubGroupAccount SET SGrpAccNo='" + oSubGroupAccountEntity.SGrpAccNo + "',GrpAccSL='" + oSubGroupAccountEntity.GrpAccSL + "'," + "SGrpAccName='" + oSubGroupAccountEntity.SGrpAccName + "',Remarks='" + oSubGroupAccountEntity.Remarks + "',LastModifiedBy='" + oSubGroupAccountEntity.LastModifiedBy + "' WHERE SGrpAccSL=" + oSubGroupAccountEntity.SGrpAccSL, con); try { cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); i = 1; } catch { } con.Close(); return(i); }
public int InsertSubGroupAccount(SubGroupAccountEntity oSubGroupAccountEntity) { con = oConnectionDatabase.DatabaseConnection(); int i = 0; cmd = new SqlCommand("INSERT INTO tblSubGroupAccount (SGrpAccNo,GrpAccSL,SGrpAccName,Remarks," + "CrateBy,LastModifiedBy)" + "VALUES('" + oSubGroupAccountEntity.SGrpAccNo + "','" + oSubGroupAccountEntity.GrpAccSL + "','" + oSubGroupAccountEntity.SGrpAccName + "'," + "'" + oSubGroupAccountEntity.Remarks + "'," + "'" + oSubGroupAccountEntity.CrateBy + "'," + "'" + oSubGroupAccountEntity.LastModifiedBy + "')", con); try { cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); i = 1; } catch { } con.Close(); return(i); }