Beispiel #1
0
    public int DeleteChargeCategory(ChargeCategoryEntity oChargeCategoryEntity)
    {
        con = oConnectionDatabase.DatabaseConnection();
        int i = 0;

        cmd = new SqlCommand("DELETE FROM tbleChargeCategory WHERE ChargeCategoryID=" + oChargeCategoryEntity.ChargeCategoryID, con);
        try
        {
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            i = 1;
        }
        catch { }
        con.Close();
        return(i);
    }
Beispiel #2
0
    public int InsertChargeCategory(ChargeCategoryEntity oChargeCategoryEntity)
    {
        con = oConnectionDatabase.DatabaseConnection();
        int i = 0;

        cmd = new SqlCommand("INSERT INTO tbleChargeCategory (ChargeCategoryCode,ChargeCategoryName,ChargeCategoryRemarks,ChargeCategoryCreatedBy,ChargeCategoryLastModifiedBy) VALUES('" + oChargeCategoryEntity.ChargeCategoryCode + "','" + oChargeCategoryEntity.ChargeCategoryName + "','" + oChargeCategoryEntity.ChargeCategoryRemarks + "','" + oChargeCategoryEntity.ChargeCategoryCreatedBy + "','" + oChargeCategoryEntity.ChargeCategoryLastModifiedBy + "')", con);
        try
        {
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            i = 1;
        }
        catch { }
        con.Close();
        return(i);
    }
Beispiel #3
0
    public int UpdateChargeCategory(ChargeCategoryEntity oChargeCategoryEntity)
    {
        con = oConnectionDatabase.DatabaseConnection();
        int i = 0;

        cmd = new SqlCommand("UPDATE  tbleChargeCategory SET ChargeCategoryName='" + oChargeCategoryEntity.ChargeCategoryName + "',ChargeCategoryRemarks='" + oChargeCategoryEntity.ChargeCategoryRemarks + "',ChargeCategoryLastModifiedBy='" + oChargeCategoryEntity.ChargeCategoryLastModifiedBy + "' WHERE ChargeCategoryID=" + oChargeCategoryEntity.ChargeCategoryID, con);
        try
        {
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            i = 1;
        }
        catch { }
        con.Close();
        return(i);
    }