Exemple #1
0
    public int UpdateChartOfAccount(ChartOfAccountEntity oChartOfAccountEntity)
    {
        con = oConnectionDatabase.DatabaseConnection();
        try { con.Open(); }
        catch { }
        int i = 0;

        //cmd = new SqlCommand("INSERT INTO tblCustomerImage (CustomerID,CustomerImage,CustomerSignature,Creatby,LastModifiedBy) VALUES('" + customerId + "','" + image + "','" + signature + "','" + Creatby + "','" + LastModifiedBy + "')", con);
        cmd = new SqlCommand("UPDATE tblChartOfAccount SET CoAccName=@CoAccName,GrpAccSL=@GrpAccSL,AccGrpSLR=@AccGrpSLR,AccTypeSL=@AccTypeSL,SGrpAccSL=@SGrpAccSL,LastModifiedBy=@LastModifiedBy WHERE CoAccNo=@CoAccNo", con);
        //cmd = new SqlCommand("INSERT INTO tblUserInfo (UserID,UserType,Password,ConfirmPassword,Active,LastModifiedBy) VALUES(@UserID,@UserType,@Password,@ConfirmPassword,@Active,@LastModifiedBy)", con);
        cmd.Parameters.AddWithValue("@CoAccNo", SqlDbType.VarChar).Value          = oChartOfAccountEntity.CoAccNo;
        cmd.Parameters.AddWithValue("@CoAccName", SqlDbType.VarChar).Value        = oChartOfAccountEntity.CoAccName;
        cmd.Parameters.AddWithValue("@OpenDate", SqlDbType.VarChar).Value         = oChartOfAccountEntity.OpenDate;
        cmd.Parameters.AddWithValue("@GrpAccSL", SqlDbType.VarChar).Value         = oChartOfAccountEntity.GrpAccSL;
        cmd.Parameters.AddWithValue("@AccGrpSLR", SqlDbType.VarChar).Value        = oChartOfAccountEntity.AccGrpSLR;
        cmd.Parameters.AddWithValue("@AccTypeSL", SqlDbType.VarChar).Value        = oChartOfAccountEntity.AccTypeSL;
        cmd.Parameters.AddWithValue("@SGrpAccSL", SqlDbType.VarChar).Value        = oChartOfAccountEntity.SGrpAccSL;
        cmd.Parameters.AddWithValue("@Posted", SqlDbType.VarChar).Value           = oChartOfAccountEntity.Posted;
        cmd.Parameters.AddWithValue("@OpenDayBalance", SqlDbType.VarChar).Value   = oChartOfAccountEntity.OpenDayBalance;
        cmd.Parameters.AddWithValue("@ClossingBalance", SqlDbType.VarChar).Value  = oChartOfAccountEntity.ClossingBalance;
        cmd.Parameters.AddWithValue("@AvailableBalance", SqlDbType.VarChar).Value = oChartOfAccountEntity.AvailableBalance;
        cmd.Parameters.AddWithValue("@CurrentBalance", SqlDbType.VarChar).Value   = oChartOfAccountEntity.CurrentBalance;
        cmd.Parameters.AddWithValue("@CreateBy", SqlDbType.VarChar).Value         = oChartOfAccountEntity.CreateBy;
        cmd.Parameters.AddWithValue("@LastModifiedBy", SqlDbType.VarChar).Value   = oChartOfAccountEntity.LastModifiedBy;

        try
        {
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            i = 1;
        }
        catch { }
        con.Close();
        return(i);
    }
Exemple #2
0
    public int DeleteChartOfAccount(ChartOfAccountEntity oChartOfAccountEntity)
    {
        con = oConnectionDatabase.DatabaseConnection();
        int i = 0;

        cmd = new SqlCommand("DELETE FROM tblChartOfAccount WHERE  CoAccSL=" + oChartOfAccountEntity.CoAccSL, con);
        try
        {
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            i = 1;
        }
        catch { }
        con.Close();
        return(i);
    }