Beispiel #1
0
    public int UpdateChargeItem(ChargeItemEntity oChargeItemEntity)
    {
        con = oConnectionDatabase.DatabaseConnection();
        int i = 0;

        cmd = new SqlCommand("UPDATE  tblChargeItem SET ChargeDetails='" + oChargeItemEntity.ChargeDetails + "',ChargeAmount='" + oChargeItemEntity.ChargeAmount + "',CApplyLowerLimit='" + oChargeItemEntity.CApplyLowerLimit + "',CApplyHigherLimit='" + oChargeItemEntity.CApplyHigherLimit + "',ChargePercentage='" + oChargeItemEntity.ChargePercentage + "',ChargeItemType='" + oChargeItemEntity.ChargeItemType + "',ChargeRemarks='" + oChargeItemEntity.ChargeRemarks + "',ChargeLastModifiedBy='" + oChargeItemEntity.ChargeLastModifiedBy + "' WHERE ChargeID=" + oChargeItemEntity.ChargeID, con);
        try
        {
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            i = 1;
        }
        catch { }
        con.Close();
        return(i);
    }
Beispiel #2
0
    public int DeleteChargeItem(ChargeItemEntity oChargeItemEntity)
    {
        con = oConnectionDatabase.DatabaseConnection();
        int i = 0;

        cmd = new SqlCommand("DELETE FROM tblChargeItem WHERE ChargeID=" + oChargeItemEntity.ChargeID, con);
        try
        {
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            i = 1;
        }
        catch { }
        con.Close();
        return(i);
    }
Beispiel #3
0
    public int InsertChargeItem(ChargeItemEntity oChargeItemEntity)
    {
        con = oConnectionDatabase.DatabaseConnection();
        int i = 0;

        cmd = new SqlCommand("INSERT INTO tblChargeItem (ChargeCode,ChargeDetails,ChargeAmount,CApplyLowerLimit,CApplyHigherLimit,ChargePercentage,ChargeItemType,ChargeRemarks,ChargeCreatedBy,ChargeLastModifiedBy) VALUES('" + oChargeItemEntity.ChargeCode + "','" + oChargeItemEntity.ChargeDetails + "','" + oChargeItemEntity.ChargeAmount + "','" + oChargeItemEntity.CApplyLowerLimit + "','" + oChargeItemEntity.CApplyHigherLimit + "','" + oChargeItemEntity.ChargePercentage + "','" + oChargeItemEntity.ChargeItemType + "','" + oChargeItemEntity.ChargeRemarks + "','" + oChargeItemEntity.ChargeCreatedBy + "','" + oChargeItemEntity.ChargeLastModifiedBy + "')", con);
        try
        {
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            i = 1;
        }
        catch { }
        con.Close();
        return(i);
    }